summaryrefslogtreecommitdiff
path: root/libc/misc/regex/regex_old.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/misc/regex/regex_old.c
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/misc/regex/regex_old.c')
-rw-r--r--libc/misc/regex/regex_old.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index 9031cebff..b64014e98 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -20,37 +20,29 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define HAVE_MEMPCPY
-#define memset __memset
-#define memcmp __memcmp
-#define strcmp __strcmp
-#define strlen __strlen
-#define wcslen __wcslen
-/* for some reason this does not work */
-#define memcpy __memcpy
-#define mbrtowc __mbrtowc
-#define wcrtomb __wcrtomb
-#define wcscoll __wcscoll
-#define wctype __wctype
-#define iswctype __iswctype
-#define iswalnum __iswalnum
-#define printf __printf
-#define btowc __btowc
-
/* To exclude some unwanted junk.... */
#undef emacs
-#define _REGEX_RE_COMP
+#define _GNU_SOURCE
#include <features.h>
#ifdef __UCLIBC__
# undef _LIBC
+# define _REGEX_RE_COMP
+# define HAVE_MEMPCPY
+# define STDC_HEADERS
+# define RE_TRANSLATE_TYPE char *
#endif
#include <stdlib.h>
#include <string.h>
-#define STDC_HEADERS
-#define RE_TRANSLATE_TYPE char *
+#include <stdio.h>
-extern void *__mempcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n) /*attribute_hidden*/;
+libc_hidden_proto(memset)
+libc_hidden_proto(memcmp)
+libc_hidden_proto(memcpy)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strlen)
+libc_hidden_proto(printf)
+libc_hidden_proto(mempcpy)
+libc_hidden_proto(abort)
/* AIX requires this to be the first thing in the file. */
#if defined _AIX && !defined REGEX_MALLOC
@@ -89,6 +81,15 @@ extern void *__mempcpy (void *__restrict __dest,
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
# include <wchar.h>
# include <wctype.h>
+libc_hidden_proto(wcslen)
+libc_hidden_proto(mbrtowc)
+libc_hidden_proto(wcrtomb)
+libc_hidden_proto(wcscoll)
+libc_hidden_proto(wctype)
+libc_hidden_proto(iswctype)
+libc_hidden_proto(iswalnum)
+libc_hidden_proto(btowc)
+
# endif
# if defined _LIBC || defined __UCLIBC__
@@ -113,10 +114,10 @@ extern void *__mempcpy (void *__restrict __dest,
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
+# ifndef __UCLIBC__
# define btowc __btowc
/* We are also using some library internals. */
-# ifndef __UCLIBC__
# include <locale/localeinfo.h>
# include <locale/elem-hash.h>
# include <langinfo.h>
@@ -8280,7 +8281,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
if (msg_size > errbuf_size)
{
#if defined HAVE_MEMPCPY || defined _LIBC
- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
#else
memcpy (errbuf, msg, errbuf_size - 1);
errbuf[errbuf_size - 1] = 0;