summaryrefslogtreecommitdiff
path: root/libc/misc
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/misc
parent86ea254301f7e2fcd860c4072c0a938b4e048d42 (diff)
Mark some functions as GNU, provide missing hidden memmem, remove _ISOC99/XOPEN_SOURCE
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/assert/__assert.c1
-rw-r--r--libc/misc/ftw/ftw.c1
-rw-r--r--libc/misc/locale/locale.c3
-rw-r--r--libc/misc/regex/regcomp.c2
-rw-r--r--libc/misc/regex/regex.c8
-rw-r--r--libc/misc/regex/regex_old.c10
-rw-r--r--libc/misc/regex/regexec.c2
-rw-r--r--libc/misc/time/time.c3
-rw-r--r--libc/misc/wchar/wchar.c1
9 files changed, 19 insertions, 12 deletions
diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c
index 1ab84fc56..bd3b3a91d 100644
--- a/libc/misc/assert/__assert.c
+++ b/libc/misc/assert/__assert.c
@@ -27,7 +27,6 @@
* and is useful in debugging the stdio code.
*/
-#define _ISOC99_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index 18da40a33..6521b44e4 100644
--- a/libc/misc/ftw/ftw.c
+++ b/libc/misc/ftw/ftw.c
@@ -22,7 +22,6 @@
# include <config.h>
#endif
-#define _XOPEN_SOURCE 500
#include <features.h>
#ifdef __UCLIBC__
#undef _LIBC
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index 95b0917df..ca69c1cea 100644
--- a/libc/misc/locale/locale.c
+++ b/libc/misc/locale/locale.c
@@ -60,7 +60,6 @@
libc_hidden_proto(memcpy)
libc_hidden_proto(memset)
-libc_hidden_proto(stpcpy)
libc_hidden_proto(strtok_r)
libc_hidden_proto(strlen)
libc_hidden_proto(strcmp)
@@ -192,6 +191,7 @@ static const char utf8[] = "UTF-8";
*/
static char hr_locale[(MAX_LOCALE_CATEGORY_STR * LC_ALL) + MAX_LOCALE_STR];
+libc_hidden_proto(stpcpy)
libc_hidden_proto(newlocale)
static void update_hr_locale(const unsigned char *spec)
@@ -1082,6 +1082,7 @@ libc_hidden_def(__XL_NPP(nl_langinfo))
/**********************************************************************/
#ifdef L_newlocale
+libc_hidden_proto(stpcpy)
libc_hidden_proto(newlocale)
#ifdef __UCLIBC_MJN3_ONLY__
diff --git a/libc/misc/regex/regcomp.c b/libc/misc/regex/regcomp.c
index 94e0314b5..471ea55f0 100644
--- a/libc/misc/regex/regcomp.c
+++ b/libc/misc/regex/regcomp.c
@@ -532,7 +532,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
{
if (BE (msg_size > errbuf_size, 0))
{
-#if defined HAVE_MEMPCPY || defined _LIBC
+#if (defined HAVE_MEMPCPY || defined _LIBC) && defined __USE_GNU
*((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
#else
memcpy (errbuf, msg, errbuf_size - 1);
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index 77c09a011..9328f6025 100644
--- a/libc/misc/regex/regex.c
+++ b/libc/misc/regex/regex.c
@@ -28,7 +28,9 @@
#ifdef __UCLIBC__
#undef _LIBC
#define _REGEX_RE_COMP
-#define HAVE_MEMPCPY
+#ifdef __USE_GNU
+# define HAVE_MEMPCPY
+#endif
#define HAVE_LANGINFO
#define HAVE_LANGINFO_CODESET
#include <stdbool.h>
@@ -83,8 +85,10 @@ libc_hidden_proto(strlen)
libc_hidden_proto(strncpy)
libc_hidden_proto(getenv)
libc_hidden_proto(strcasecmp)
-libc_hidden_proto(mempcpy)
libc_hidden_proto(abort)
+#ifdef __USE_GNU
+libc_hidden_proto(mempcpy)
+#endif
#endif
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index 29640734d..cf5843ec5 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -26,7 +26,9 @@
#ifdef __UCLIBC__
# undef _LIBC
# define _REGEX_RE_COMP
-# define HAVE_MEMPCPY
+# ifdef __USE_GNU
+# define HAVE_MEMPCPY
+# endif
# define STDC_HEADERS
# define RE_TRANSLATE_TYPE char *
#endif
@@ -41,8 +43,10 @@ libc_hidden_proto(memcpy)
libc_hidden_proto(strcmp)
libc_hidden_proto(strlen)
libc_hidden_proto(printf)
-libc_hidden_proto(mempcpy)
libc_hidden_proto(abort)
+#ifdef __USE_GNU
+libc_hidden_proto(mempcpy)
+#endif
/* AIX requires this to be the first thing in the file. */
#if defined _AIX && !defined REGEX_MALLOC
@@ -8281,7 +8285,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
{
if (msg_size > errbuf_size)
{
-#if defined HAVE_MEMPCPY || defined _LIBC
+#if (defined HAVE_MEMPCPY || defined _LIBC) && defined __USE_GNU
*((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
#else
memcpy (errbuf, msg, errbuf_size - 1);
diff --git a/libc/misc/regex/regexec.c b/libc/misc/regex/regexec.c
index bafc34ce0..2c8917e19 100644
--- a/libc/misc/regex/regexec.c
+++ b/libc/misc/regex/regexec.c
@@ -385,7 +385,7 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs,
if (BE (s == NULL, 0))
return -2;
-#if defined _LIBC || defined __UCLIBC__
+#if (defined _LIBC || defined __UCLIBC__) && defined __USE_GNU
memcpy (__mempcpy (s, string1, length1), string2, length2);
#else
memcpy (s, string1, length1);
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index f95ad2351..e6d96756e 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -164,7 +164,6 @@ libc_hidden_proto(strcmp)
libc_hidden_proto(strcpy)
libc_hidden_proto(strlen)
libc_hidden_proto(strncpy)
-libc_hidden_proto(strnlen)
/* libc_hidden_proto(sprintf) */
libc_hidden_proto(open)
libc_hidden_proto(read)
@@ -606,6 +605,8 @@ libc_hidden_def(localtime_r)
#ifdef __UCLIBC_HAS_TM_EXTENSIONS__
+libc_hidden_proto(strnlen)
+
struct ll_tzname_item;
typedef struct ll_tzname_item {
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 91a78fb22..64bab37e0 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -98,7 +98,6 @@
* Manuel
*/
-#define _ISOC99_SOURCE
#include <errno.h>
#include <stddef.h>
#include <limits.h>