summaryrefslogtreecommitdiff
path: root/libc/string/generic
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-03-22 15:49:22 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-03-22 15:49:22 +0000
commit55b24e4e95a715b451507f2790d292fa8b1c2c1c (patch)
treeae6464b93a9b660617b9f7a569276945294dcce7 /libc/string/generic
parent86ea254301f7e2fcd860c4072c0a938b4e048d42 (diff)
Mark some functions as GNU, provide missing hidden memmem, remove _ISOC99/XOPEN_SOURCE
Diffstat (limited to 'libc/string/generic')
-rw-r--r--libc/string/generic/memmem.c2
-rw-r--r--libc/string/generic/mempcpy.c2
-rw-r--r--libc/string/generic/memrchr.c2
-rw-r--r--libc/string/generic/rawmemchr.c2
-rw-r--r--libc/string/generic/strchrnul.c2
-rw-r--r--libc/string/generic/strnlen.c2
-rw-r--r--libc/string/generic/strtok_r.c8
7 files changed, 19 insertions, 1 deletions
diff --git a/libc/string/generic/memmem.c b/libc/string/generic/memmem.c
index c2e8547be..5d4e6f151 100644
--- a/libc/string/generic/memmem.c
+++ b/libc/string/generic/memmem.c
@@ -19,6 +19,7 @@
#include <string.h>
#include <stddef.h>
+#ifdef __USE_GNU
libc_hidden_proto(memmem)
libc_hidden_proto(memcmp)
@@ -50,3 +51,4 @@ void *memmem (const void *haystack, size_t haystack_len,
return NULL;
}
libc_hidden_def(memmem)
+#endif
diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c
index 7c251914d..46d19024b 100644
--- a/libc/string/generic/mempcpy.c
+++ b/libc/string/generic/mempcpy.c
@@ -7,6 +7,7 @@
#include <string.h>
+#ifdef __USE_GNU
libc_hidden_proto(mempcpy)
libc_hidden_proto(memcpy)
@@ -16,3 +17,4 @@ void *mempcpy (void *dstpp, const void *srcpp, size_t len)
return (void *)(((char *)dstpp) + len);
}
libc_hidden_def(mempcpy)
+#endif
diff --git a/libc/string/generic/memrchr.c b/libc/string/generic/memrchr.c
index f63efa46b..43439d5ce 100644
--- a/libc/string/generic/memrchr.c
+++ b/libc/string/generic/memrchr.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <limits.h>
+#ifdef __USE_GNU
libc_hidden_proto(memrchr)
libc_hidden_proto(abort)
@@ -174,3 +175,4 @@ void *memrchr (const void * s, int c_in, size_t n)
return 0;
}
libc_hidden_def(memrchr)
+#endif
diff --git a/libc/string/generic/rawmemchr.c b/libc/string/generic/rawmemchr.c
index 85fc09836..6bf245265 100644
--- a/libc/string/generic/rawmemchr.c
+++ b/libc/string/generic/rawmemchr.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <limits.h>
+#ifdef __USE_GNU
libc_hidden_proto(rawmemchr)
libc_hidden_proto(abort)
@@ -160,3 +161,4 @@ void *rawmemchr (const void * s, int c_in)
}
}
libc_hidden_def(rawmemchr)
+#endif
diff --git a/libc/string/generic/strchrnul.c b/libc/string/generic/strchrnul.c
index e699a6dfa..6b2d85e9b 100644
--- a/libc/string/generic/strchrnul.c
+++ b/libc/string/generic/strchrnul.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <stdlib.h>
+#ifdef __USE_GNU
libc_hidden_proto(strchrnul)
libc_hidden_proto(abort)
@@ -165,3 +166,4 @@ char *strchrnul (const char *s, int c_in)
return NULL;
}
libc_hidden_def(strchrnul)
+#endif
diff --git a/libc/string/generic/strnlen.c b/libc/string/generic/strnlen.c
index 31b5ba8e0..3156e469a 100644
--- a/libc/string/generic/strnlen.c
+++ b/libc/string/generic/strnlen.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <stdlib.h>
+#ifdef __USE_GNU
libc_hidden_proto(strnlen)
libc_hidden_proto(abort)
@@ -160,3 +161,4 @@ size_t strnlen (const char *str, size_t maxlen)
return char_ptr - str;
}
libc_hidden_def(strnlen)
+#endif
diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c
index 0ab18b35e..bae394a80 100644
--- a/libc/string/generic/strtok_r.c
+++ b/libc/string/generic/strtok_r.c
@@ -22,7 +22,13 @@
libc_hidden_proto(strtok_r)
libc_hidden_proto(strspn)
libc_hidden_proto(strpbrk)
+#ifdef __USE_GNU
+# define __rawmemchr rawmemchr
libc_hidden_proto(rawmemchr)
+#else
+# define __rawmemchr strchr
+libc_hidden_proto(strchr)
+#endif
/* Parse S into tokens separated by characters in DELIM.
If S is NULL, the saved pointer in SAVE_PTR is used as
@@ -54,7 +60,7 @@ char *strtok_r (char *s, const char *delim, char **save_ptr)
s = strpbrk (token, delim);
if (s == NULL)
/* This token finishes the string. */
- *save_ptr = rawmemchr (token, '\0');
+ *save_ptr = __rawmemchr (token, '\0');
else
{
/* Terminate the token and make *SAVE_PTR point past it. */