diff options
Diffstat (limited to 'libc/stdlib')
-rw-r--r-- | libc/stdlib/abort.c | 4 | ||||
-rw-r--r-- | libc/stdlib/bsd_getpt.c | 32 | ||||
-rw-r--r-- | libc/stdlib/gcvt.c | 2 | ||||
-rw-r--r-- | libc/stdlib/getpt.c | 20 | ||||
-rw-r--r-- | libc/stdlib/grantpt.c | 8 | ||||
-rw-r--r-- | libc/stdlib/malloc-simple/alloc.c | 1 | ||||
-rw-r--r-- | libc/stdlib/malloc-standard/mallinfo.c | 5 | ||||
-rw-r--r-- | libc/stdlib/malloc-standard/malloc.h | 1 | ||||
-rw-r--r-- | libc/stdlib/malloc-standard/realloc.c | 2 | ||||
-rw-r--r-- | libc/stdlib/malloc/heap_debug.c | 2 | ||||
-rw-r--r-- | libc/stdlib/malloc/malloc.c | 2 | ||||
-rw-r--r-- | libc/stdlib/malloc/malloc_debug.c | 3 | ||||
-rw-r--r-- | libc/stdlib/ptsname.c | 30 | ||||
-rw-r--r-- | libc/stdlib/random.c | 1 | ||||
-rw-r--r-- | libc/stdlib/random_r.c | 7 | ||||
-rw-r--r-- | libc/stdlib/stdlib.c | 89 | ||||
-rw-r--r-- | libc/stdlib/strtod.c | 19 | ||||
-rw-r--r-- | libc/stdlib/strtof.c | 2 | ||||
-rw-r--r-- | libc/stdlib/strtold.c | 2 | ||||
-rw-r--r-- | libc/stdlib/system.c | 3 | ||||
-rw-r--r-- | libc/stdlib/unlockpt.c | 2 |
21 files changed, 138 insertions, 99 deletions
diff --git a/libc/stdlib/abort.c b/libc/stdlib/abort.c index 78b57fbd3..d24d1a94c 100644 --- a/libc/stdlib/abort.c +++ b/libc/stdlib/abort.c @@ -18,6 +18,8 @@ Cambridge, MA 02139, USA. */ /* Hacked up for uClibc by Erik Andersen */ +#define sigaction __sigaction + #define _GNU_SOURCE #include <features.h> #include <signal.h> @@ -32,6 +34,8 @@ Cambridge, MA 02139, USA. */ /* Our last ditch effort to commit suicide */ #if defined(__alpha__) #define ABORT_INSTRUCTION asm ("call_pal 0") +#elif defined(__arm__) +#define ABORT_INSTRUCTION asm ("bl abort") #elif defined(__hppa__) #define ABORT_INSTRUCTION asm ("iitlbp %r0,(%r0)") #elif defined(__i386__) diff --git a/libc/stdlib/bsd_getpt.c b/libc/stdlib/bsd_getpt.c index f219afd29..aec0ca4bc 100644 --- a/libc/stdlib/bsd_getpt.c +++ b/libc/stdlib/bsd_getpt.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ #include <errno.h> #include <fcntl.h> @@ -31,13 +31,13 @@ #ifndef PTYNAME1 #define PTYNAME1 "pqrsPQRS" #endif -const char _ptyname1[] = PTYNAME1; +const char __libc_ptyname1[] attribute_hidden = PTYNAME1; /* Letters indicating the position within a series. */ #ifndef PTYNAME2 #define PTYNAME2 "0123456789abcdefghijklmnopqrstuv"; #endif -const char _ptyname2[] = PTYNAME2; +const char __libc_ptyname2[] attribute_hidden = PTYNAME2; /* Open a master pseudo terminal and return its file descriptor. */ @@ -48,17 +48,15 @@ __getpt (void) const char *p, *q; char *s; - __memcpy (buf, _PATH_PTY, sizeof (_PATH_PTY)); - s = buf + __strlen (buf); - + s = __mempcpy (buf, _PATH_PTY, sizeof (_PATH_PTY) - 1); /* s[0] and s[1] will be filled in the loop. */ s[2] = '\0'; - for (p = _ptyname1; *p != '\0'; ++p) + for (p = __libc_ptyname1; *p != '\0'; ++p) { s[0] = *p; - for (q = _ptyname2; *q != '\0'; ++q) + for (q = __libc_ptyname2; *q != '\0'; ++q) { int fd; @@ -73,6 +71,6 @@ __getpt (void) } } - errno = ENOENT; + __set_errno (ENOENT); return -1; } diff --git a/libc/stdlib/gcvt.c b/libc/stdlib/gcvt.c index 71bfcec80..75e3bbe70 100644 --- a/libc/stdlib/gcvt.c +++ b/libc/stdlib/gcvt.c @@ -5,7 +5,7 @@ #define MAX_NDIGIT 17 char *gcvt (double number, int ndigit, char *buf) { - sprintf(buf, "%.*g", (ndigit > MAX_NDIGIT)? MAX_NDIGIT : ndigit, number); + __sprintf(buf, "%.*g", (ndigit > MAX_NDIGIT)? MAX_NDIGIT : ndigit, number); return buf; } #endif diff --git a/libc/stdlib/getpt.c b/libc/stdlib/getpt.c index c219adb24..4bd082823 100644 --- a/libc/stdlib/getpt.c +++ b/libc/stdlib/getpt.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ #include <errno.h> #include <fcntl.h> @@ -39,7 +39,7 @@ #if !defined __UNIX98PTY_ONLY__ /* Prototype for function that opens BSD-style master pseudo-terminals. */ -int __bsd_getpt (void); +extern int __bsd_getpt (void) attribute_hidden; #endif /* Open a master pseudo terminal and return its file descriptor. */ diff --git a/libc/stdlib/grantpt.c b/libc/stdlib/grantpt.c index 5b4427a0c..2c59cd678 100644 --- a/libc/stdlib/grantpt.c +++ b/libc/stdlib/grantpt.c @@ -45,15 +45,15 @@ static int pts_name (int fd, char **pts, size_t buf_len); terminal associated with the master pseudo terminal specified by FD. */ int +#if !defined __ASSUME_DEVPTS__ grantpt (int fd) +#else +grantpt (attribute_unused int fd) +#endif { #if !defined __ASSUME_DEVPTS__ struct statfs fsbuf; -# ifdef PATH_MAX char _buf[PATH_MAX]; -# else - char _buf[512]; -# endif char *buf = _buf; if (pts_name (fd, &buf, sizeof (_buf))) diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c index d20768738..5a208bf28 100644 --- a/libc/stdlib/malloc-simple/alloc.c +++ b/libc/stdlib/malloc-simple/alloc.c @@ -6,6 +6,7 @@ * Parts of the memalign code were stolen from malloc-930716. */ +#define mmap __mmap #define munmap __munmap #define _GNU_SOURCE diff --git a/libc/stdlib/malloc-standard/mallinfo.c b/libc/stdlib/malloc-standard/mallinfo.c index 51ac423fe..f6c2a9104 100644 --- a/libc/stdlib/malloc-standard/mallinfo.c +++ b/libc/stdlib/malloc-standard/mallinfo.c @@ -18,7 +18,7 @@ /* ------------------------------ mallinfo ------------------------------ */ -struct mallinfo mallinfo(void) +struct mallinfo attribute_hidden __mallinfo(void) { mstate av; struct mallinfo mi; @@ -78,6 +78,7 @@ struct mallinfo mallinfo(void) UNLOCK; return mi; } +strong_alias(__mallinfo,mallinfo) void malloc_stats(FILE *file) { @@ -87,7 +88,7 @@ void malloc_stats(FILE *file) file = stderr; } - mi = mallinfo(); + mi = __mallinfo(); fprintf(file, "total bytes allocated = %10u\n", (unsigned int)(mi.arena + mi.hblkhd)); fprintf(file, "total bytes in use bytes = %10u\n", (unsigned int)(mi.uordblks + mi.hblkhd)); fprintf(file, "total non-mmapped bytes allocated = %10d\n", mi.arena); diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h index 0e8aed363..338edeabf 100644 --- a/libc/stdlib/malloc-standard/malloc.h +++ b/libc/stdlib/malloc-standard/malloc.h @@ -14,6 +14,7 @@ Hacked up for uClibc by Erik Andersen <andersen@codepoet.org> */ +#define mmap __mmap #define sysconf __sysconf #include <features.h> diff --git a/libc/stdlib/malloc-standard/realloc.c b/libc/stdlib/malloc-standard/realloc.c index 3d77442af..36bfe4d99 100644 --- a/libc/stdlib/malloc-standard/realloc.c +++ b/libc/stdlib/malloc-standard/realloc.c @@ -14,6 +14,8 @@ Hacked up for uClibc by Erik Andersen <andersen@codepoet.org> */ +#define mremap __mremap + #include "malloc.h" diff --git a/libc/stdlib/malloc/heap_debug.c b/libc/stdlib/malloc/heap_debug.c index c1a127317..4804ba9ee 100644 --- a/libc/stdlib/malloc/heap_debug.c +++ b/libc/stdlib/malloc/heap_debug.c @@ -11,6 +11,8 @@ * Written by Miles Bader <miles@gnu.org> */ +#define vfprintf __vfprintf + #include <stdlib.h> #include <stdio.h> #include <stdarg.h> diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c index e4523adb2..44eb2c66f 100644 --- a/libc/stdlib/malloc/malloc.c +++ b/libc/stdlib/malloc/malloc.c @@ -11,6 +11,8 @@ * Written by Miles Bader <miles@gnu.org> */ +#define mmap __mmap + #include <stdlib.h> #include <unistd.h> #include <errno.h> diff --git a/libc/stdlib/malloc/malloc_debug.c b/libc/stdlib/malloc/malloc_debug.c index b93b1eac6..e8711ff77 100644 --- a/libc/stdlib/malloc/malloc_debug.c +++ b/libc/stdlib/malloc/malloc_debug.c @@ -11,6 +11,9 @@ * Written by Miles Bader <miles@gnu.org> */ +#define atoi __atoi +#define vfprintf __vfprintf + #include <stdlib.h> #include <stdio.h> #include <unistd.h> diff --git a/libc/stdlib/ptsname.c b/libc/stdlib/ptsname.c index 8cac95783..769944ba2 100644 --- a/libc/stdlib/ptsname.c +++ b/libc/stdlib/ptsname.c @@ -1,21 +1,23 @@ -/* Copyright (C) 1998 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define isatty __isatty #define _ISOC99_SOURCE #include <stdio.h> @@ -39,7 +41,7 @@ || (major ((Dev)) == 4 && minor ((Dev)) >= 128 && minor ((Dev)) < 192) \ || (major ((Dev)) >= 128 && major ((Dev)) < 136)) -/* Check if DEV corresponds to a master pseudo terminal device. */ +/* Check if DEV corresponds to a slave pseudo terminal device. */ #define SLAVE_P(Dev) \ (major ((Dev)) == 3 \ || (major ((Dev)) == 4 && minor ((Dev)) >= 192 && minor ((Dev)) < 256) \ @@ -51,8 +53,8 @@ and 3 (slaves). */ /* The are declared in getpt.c. */ -extern const char _ptyname1[]; -extern const char _ptyname2[]; +extern const char __libc_ptyname1[] attribute_hidden; +extern const char __libc_ptyname2[] attribute_hidden; #endif @@ -86,7 +88,7 @@ int attribute_hidden __ptsname_r (int fd, char *buf, size_t buflen) # error "__UNIX98PTY_ONLY__ enabled but TIOCGPTN ioctl not supported by your kernel." #endif #ifdef TIOCGPTN - if (ioctl (fd, TIOCGPTN, &ptyno) == 0) + if (__ioctl (fd, TIOCGPTN, &ptyno) == 0) { /* Buffer we use to print the number in. */ char numbuf[__BUFLEN_INT10TOSTR]; @@ -95,7 +97,7 @@ int attribute_hidden __ptsname_r (int fd, char *buf, size_t buflen) p = _int10tostr(&numbuf[sizeof numbuf - 1], ptyno); - if (buflen < sizeof devpts + &numbuf[sizeof numbuf - 1] - p) + if (buflen < sizeof(devpts) + (size_t)(&numbuf[sizeof(numbuf) - 1] - p)) { errno = ERANGE; return ERANGE; diff --git a/libc/stdlib/random.c b/libc/stdlib/random.c index d40420740..eb146098a 100644 --- a/libc/stdlib/random.c +++ b/libc/stdlib/random.c @@ -25,6 +25,7 @@ #define random_r __random_r #define srandom_r __srandom_r #define setstate_r __setstate_r +#define initstate_r __initstate_r #define _GNU_SOURCE #include <features.h> diff --git a/libc/stdlib/random_r.c b/libc/stdlib/random_r.c index 0733bf900..b10f29519 100644 --- a/libc/stdlib/random_r.c +++ b/libc/stdlib/random_r.c @@ -258,11 +258,7 @@ strong_alias(__srandom_r,srandom_r) Note: The first thing we do is save the current state, if any, just like setstate so that it doesn't matter when initstate is called. Returns a pointer to the old state. */ -int initstate_r (seed, arg_state, n, buf) - unsigned int seed; - char *arg_state; - size_t n; - struct random_data *buf; +int attribute_hidden __initstate_r (unsigned int seed, char *arg_state, size_t n, struct random_data *buf) { int type; int degree; @@ -310,6 +306,7 @@ fail: __set_errno (EINVAL); return -1; } +strong_alias(__initstate_r,initstate_r) /* Restore the state from the given state array. Note: It is important that we also remember the locations of the pointers diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c index 09524d013..3b7d37ccb 100644 --- a/libc/stdlib/stdlib.c +++ b/libc/stdlib/stdlib.c @@ -36,6 +36,8 @@ #define mbsrtowcs __mbsrtowcs #define mbrtowc __mbrtowc #define mbrlen __mbrlen +#define iswspace __iswspace +#define iswspace_l __iswspace_l #define wcrtomb __wcrtomb #define _ISOC99_SOURCE /* for ULLONG primarily... */ @@ -71,6 +73,14 @@ #include <stdlib.h> #include <locale.h> +extern long int __strtol (__const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)) __wur attribute_hidden; +__extension__ +extern long long int __strtoll (__const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __THROW __nonnull ((1)) __wur attribute_hidden; + #ifdef __UCLIBC_HAS_WCHAR__ #include <wchar.h> @@ -191,9 +201,13 @@ _stdlib_wcsto_ll(register const wchar_t * __restrict str, /**********************************************************************/ #ifdef L_atof +extern double __strtod (__const char *__restrict __nptr, + char **__restrict __endptr) + __THROW __nonnull ((1)) __wur attribute_hidden; + double atof(const char *nptr) { - return strtod(nptr, (char **) NULL); + return __strtod(nptr, (char **) NULL); } #endif @@ -253,10 +267,11 @@ strong_alias(llabs,imaxabs) #if INT_MAX < LONG_MAX -int atoi(const char *nptr) +int attribute_hidden __atoi(const char *nptr) { - return (int) strtol(nptr, (char **) NULL, 10); + return (int) __strtol(nptr, (char **) NULL, 10); } +strong_alias(__atoi,atoi) #endif /* INT_MAX < LONG_MAX */ @@ -264,17 +279,19 @@ int atoi(const char *nptr) /**********************************************************************/ #ifdef L_atol -long atol(const char *nptr) +long attribute_hidden __atol(const char *nptr) { - return strtol(nptr, (char **) NULL, 10); + return __strtol(nptr, (char **) NULL, 10); } +strong_alias(__atol,atol) #if UINT_MAX == ULONG_MAX -strong_alias(atol,atoi) +hidden_strong_alias(__atol,__atoi) +strong_alias(__atol,atoi) #endif #if defined(ULLONG_MAX) && (ULLONG_MAX == ULONG_MAX) -strong_alias(atol,atoll) +strong_alias(__atol,atoll) #endif #endif @@ -285,7 +302,7 @@ strong_alias(atol,atoll) long long atoll(const char *nptr) { - return strtoll(nptr, (char **) NULL, 10); + return __strtoll(nptr, (char **) NULL, 10); } #endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */ @@ -294,12 +311,14 @@ long long atoll(const char *nptr) /**********************************************************************/ #if defined(L_strtol) || defined(L_strtol_l) -long __XL(strtol)(const char * __restrict str, char ** __restrict endptr, +long attribute_hidden __UCXL(strtol)(const char * __restrict str, char ** __restrict endptr, int base __LOCALE_PARAM ) { return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 1 __LOCALE_ARG ); } +__UCXL_ALIAS(strtol) + #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_strtol_l) strong_alias(strtol,strtoimax) #endif @@ -308,15 +327,13 @@ strong_alias(strtol,strtoimax) strong_alias(__XL(strtol),__XL(strtoll)) #endif -__XL_ALIAS(strtol) - #endif /**********************************************************************/ #if defined(L_strtoll) || defined(L_strtoll_l) #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) -long long __XL(strtoll)(const char * __restrict str, +long long attribute_hidden __UCXL(strtoll)(const char * __restrict str, char ** __restrict endptr, int base __LOCALE_PARAM ) { @@ -324,6 +341,8 @@ long long __XL(strtoll)(const char * __restrict str, __LOCALE_ARG ); } +__UCXL_ALIAS(strtoll) + #if !defined(L_strtoll_l) #if (ULLONG_MAX == UINTMAX_MAX) strong_alias(strtoll,strtoimax) @@ -331,21 +350,21 @@ strong_alias(strtoll,strtoimax) strong_alias(strtoll,strtoq) #endif -__XL_ALIAS(strtoll) - #endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */ #endif /**********************************************************************/ #if defined(L_strtoul) || defined(L_strtoul_l) -unsigned long __XL(strtoul)(const char * __restrict str, +unsigned long attribute_hidden __UCXL(strtoul)(const char * __restrict str, char ** __restrict endptr, int base __LOCALE_PARAM ) { return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 0 __LOCALE_ARG ); } +__UCXL_ALIAS(strtoul) + #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_strtoul_l) strong_alias(strtoul,strtoumax) #endif @@ -354,7 +373,6 @@ strong_alias(strtoul,strtoumax) strong_alias(__XL(strtoul),__XL(strtoull)) #endif -__XL_ALIAS(strtoul) #endif /**********************************************************************/ @@ -362,13 +380,15 @@ __XL_ALIAS(strtoul) #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) -unsigned long long __XL(strtoull)(const char * __restrict str, +unsigned long long attribute_hidden __UCXL(strtoull)(const char * __restrict str, char ** __restrict endptr, int base __LOCALE_PARAM ) { return __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 0 __LOCALE_ARG ); } +__UCXL_ALIAS(strtoull) + #if !defined(L_strtoull_l) #if (ULLONG_MAX == UINTMAX_MAX) strong_alias(strtoull,strtoumax) @@ -376,8 +396,6 @@ strong_alias(strtoull,strtoumax) strong_alias(strtoull,strtouq) #endif -__XL_ALIAS(strtoull) - #endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */ #endif @@ -435,7 +453,7 @@ __XL_ALIAS(strtoull) #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -unsigned long _stdlib_strto_l(register const Wchar * __restrict str, +unsigned long attribute_hidden _stdlib_strto_l(register const Wchar * __restrict str, Wchar ** __restrict endptr, int base, int sflag) { @@ -448,7 +466,7 @@ unsigned long _stdlib_strto_l(register const Wchar * __restrict str, /* This is the main work fuction which handles both strtol (sflag = 1) and * strtoul (sflag = 0). */ -unsigned long __XL_NPP(_stdlib_strto_l)(register const Wchar * __restrict str, +unsigned long attribute_hidden __XL_NPP(_stdlib_strto_l)(register const Wchar * __restrict str, Wchar ** __restrict endptr, int base, int sflag __LOCALE_PARAM ) { @@ -580,7 +598,7 @@ unsigned long __XL_NPP(_stdlib_strto_l)(register const Wchar * __restrict str, #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -unsigned long long _stdlib_strto_ll(register const Wchar * __restrict str, +unsigned long long attribute_hidden _stdlib_strto_ll(register const Wchar * __restrict str, Wchar ** __restrict endptr, int base, int sflag) { @@ -593,7 +611,7 @@ unsigned long long _stdlib_strto_ll(register const Wchar * __restrict str, /* This is the main work fuction which handles both strtoll (sflag = 1) and * strtoull (sflag = 0). */ -unsigned long long __XL_NPP(_stdlib_strto_ll)(register const Wchar * __restrict str, +unsigned long long attribute_hidden __XL_NPP(_stdlib_strto_ll)(register const Wchar * __restrict str, Wchar ** __restrict endptr, int base, int sflag __LOCALE_PARAM ) { @@ -964,12 +982,14 @@ size_t wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n) /**********************************************************************/ #if defined(L_wcstol) || defined(L_wcstol_l) -long __XL(wcstol)(const wchar_t * __restrict str, +long __UCXL(wcstol)(const wchar_t * __restrict str, wchar_t ** __restrict endptr, int base __LOCALE_PARAM ) { return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 1 __LOCALE_ARG ); } +__UCXL_ALIAS(wcstol) + #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstol_l) strong_alias(wcstol,wcstoimax) #endif @@ -978,15 +998,13 @@ strong_alias(wcstol,wcstoimax) strong_alias(__XL(wcstol),__XL(wcstoll)) #endif -__XL_ALIAS(wcstol) - #endif /**********************************************************************/ #if defined(L_wcstoll) || defined(L_wcstoll_l) #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) -long long __XL(wcstoll)(const wchar_t * __restrict str, +long long attribute_hidden __UCXL(wcstoll)(const wchar_t * __restrict str, wchar_t ** __restrict endptr, int base __LOCALE_PARAM ) { @@ -994,6 +1012,8 @@ long long __XL(wcstoll)(const wchar_t * __restrict str, __LOCALE_ARG ); } +__UCXL_ALIAS(wcstoll) + #if !defined(L_wcstoll_l) #if (ULLONG_MAX == UINTMAX_MAX) strong_alias(wcstoll,wcstoimax) @@ -1001,21 +1021,21 @@ strong_alias(wcstoll,wcstoimax) strong_alias(wcstoll,wcstoq) #endif -__XL_ALIAS(wcstoll) - #endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */ #endif /**********************************************************************/ #if defined(L_wcstoul) || defined(L_wcstoul_l) -unsigned long __XL(wcstoul)(const wchar_t * __restrict str, +unsigned long attribute_hidden __UCXL(wcstoul)(const wchar_t * __restrict str, wchar_t ** __restrict endptr, int base __LOCALE_PARAM ) { return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 0 __LOCALE_ARG ); } +__UCXL_ALIAS(wcstoul) + #if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstoul_l) strong_alias(wcstoul,wcstoumax) #endif @@ -1024,21 +1044,21 @@ strong_alias(wcstoul,wcstoumax) strong_alias(__XL(wcstoul),__XL(wcstoull)) #endif -__XL_ALIAS(wcstoul) - #endif /**********************************************************************/ #if defined(L_wcstoull) || defined(L_wcstoull_l) #if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) -unsigned long long __XL(wcstoull)(const wchar_t * __restrict str, +unsigned long long attribute_hidden __UCXL(wcstoull)(const wchar_t * __restrict str, wchar_t ** __restrict endptr, int base __LOCALE_PARAM ) { return __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 0 __LOCALE_ARG ); } +__UCXL_ALIAS(wcstoull) + #if !defined(L_wcstoull_l) #if (ULLONG_MAX == UINTMAX_MAX) strong_alias(wcstoull,wcstoumax) @@ -1046,10 +1066,7 @@ strong_alias(wcstoull,wcstoumax) strong_alias(wcstoull,wcstouq) #endif -__XL_ALIAS(wcstoull) - #endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */ #endif /**********************************************************************/ - diff --git a/libc/stdlib/strtod.c b/libc/stdlib/strtod.c index 47f809f3e..3a5adcd4e 100644 --- a/libc/stdlib/strtod.c +++ b/libc/stdlib/strtod.c @@ -95,6 +95,9 @@ /**********************************************************************/ +#define iswspace __iswspace +#define iswspace_l __iswspace_l + #define _ISOC99_SOURCE 1 #define _GNU_SOURCE #include <stdlib.h> @@ -203,14 +206,14 @@ extern void __fp_range_check(__fpmax_t y, __fpmax_t x) attribute_hidden; #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -__fpmax_t __strtofpmax(const Wchar *str, Wchar **endptr, int exponent_power) +__fpmax_t attribute_hidden __strtofpmax(const Wchar *str, Wchar **endptr, int exponent_power) { return __strtofpmax_l(str, endptr, exponent_power, __UCLIBC_CURLOCALE); } #else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ -__fpmax_t __XL_NPP(__strtofpmax)(const Wchar *str, Wchar **endptr, int exponent_power +__fpmax_t attribute_hidden __XL_NPP(__strtofpmax)(const Wchar *str, Wchar **endptr, int exponent_power __LOCALE_PARAM ) { __fpmax_t number; @@ -520,7 +523,7 @@ void attribute_hidden __fp_range_check(__fpmax_t y, __fpmax_t x) #endif -float __XL(strtof)(const Wchar *str, Wchar **endptr __LOCALE_PARAM ) +float attribute_hidden __UCXL(strtof)(const Wchar *str, Wchar **endptr __LOCALE_PARAM ) { #if FPMAX_TYPE == 1 return __XL_NPP(__strtofpmax)(str, endptr, 0 __LOCALE_ARG ); @@ -537,7 +540,7 @@ float __XL(strtof)(const Wchar *str, Wchar **endptr __LOCALE_PARAM ) #endif } -__XL_ALIAS(strtof) +__UCXL_ALIAS(strtof) #endif #endif @@ -557,7 +560,7 @@ __XL_ALIAS(strtof) #define Wchar char #endif -double __XL(strtod)(const Wchar *__restrict str, +double attribute_hidden __UCXL(strtod)(const Wchar *__restrict str, Wchar **__restrict endptr __LOCALE_PARAM ) { #if FPMAX_TYPE == 2 @@ -575,7 +578,7 @@ double __XL(strtod)(const Wchar *__restrict str, #endif } -__XL_ALIAS(strtod) +__UCXL_ALIAS(strtod) #endif #endif @@ -595,7 +598,7 @@ __XL_ALIAS(strtod) #define Wchar char #endif -long double __XL(strtold)(const Wchar *str, Wchar **endptr __LOCALE_PARAM ) +long double attribute_hidden __UCXL(strtold)(const Wchar *str, Wchar **endptr __LOCALE_PARAM ) { #if FPMAX_TYPE == 3 return __XL_NPP(__strtofpmax)(str, endptr, 0 __LOCALE_ARG ); @@ -612,7 +615,7 @@ long double __XL(strtold)(const Wchar *str, Wchar **endptr __LOCALE_PARAM ) #endif } -__XL_ALIAS(strtold) +__UCXL_ALIAS(strtold) #endif #endif diff --git a/libc/stdlib/strtof.c b/libc/stdlib/strtof.c index a5180677c..d25a67d05 100644 --- a/libc/stdlib/strtof.c +++ b/libc/stdlib/strtof.c @@ -23,6 +23,8 @@ * to an internal conversion from a double to a float, thereby wasting a bunch * of precision. But this is small, and works for now... */ +#define strtod __strtod + #include <stdlib.h> float strtof (const char *str, char **endptr) diff --git a/libc/stdlib/strtold.c b/libc/stdlib/strtold.c index 3848b782a..3ef1fc491 100644 --- a/libc/stdlib/strtold.c +++ b/libc/stdlib/strtold.c @@ -23,6 +23,8 @@ * to an internal conversion from a double to a long double, thereby losing * tons of precision. But this is small, and works for now... */ +#define strtod __strtod + #include <stdlib.h> long double strtold (const char *str, char **endptr) diff --git a/libc/stdlib/system.c b/libc/stdlib/system.c index e268bf5ef..616d2dda6 100644 --- a/libc/stdlib/system.c +++ b/libc/stdlib/system.c @@ -1,5 +1,6 @@ #define wait4 __wait4 #define execl __execl +#define signal __signal #include <stdio.h> #include <stddef.h> @@ -44,7 +45,7 @@ int __libc_system(char *command) signal(SIGINT, SIG_IGN); #if 0 - printf("Waiting for child %d\n", pid); + __printf("Waiting for child %d\n", pid); #endif if (wait4(pid, &wait_val, 0, 0) == -1) diff --git a/libc/stdlib/unlockpt.c b/libc/stdlib/unlockpt.c index 5dfea15d7..3f99c1c0b 100644 --- a/libc/stdlib/unlockpt.c +++ b/libc/stdlib/unlockpt.c @@ -32,7 +32,7 @@ unlockpt (int fd) int save_errno = errno; int unlock = 0; - if (ioctl (fd, TIOCSPTLCK, &unlock)) + if (__ioctl (fd, TIOCSPTLCK, &unlock)) { if (errno == EINVAL) { |