patches/uClibc/0.9.30.1/150-64bit-strtouq.patch
branchnewlib
changeset 1365 c4d124ed9f8e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/uClibc/0.9.30.1/150-64bit-strtouq.patch	Sun Apr 19 16:17:11 2009 +0000
     1.3 @@ -0,0 +1,48 @@
     1.4 +[PATCH]: Add strtouq alias (to strtoul) for 64bit
     1.5 +
     1.6 +The strtouq alias was only available on 32bit, breaking compilation of stuff
     1.7 +using strtouq on 64bit machines. At the same time use the correct return
     1.8 +type (u_quad_t).
     1.9 +
    1.10 +Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk>
    1.11 +---
    1.12 + include/stdlib.h     |    4 +++-
    1.13 + libc/stdlib/stdlib.c |    1 +
    1.14 + 2 files changed, 4 insertions(+), 1 deletion(-)
    1.15 +
    1.16 +Index: uClibc-0.9.30.1/libc/stdlib/stdlib.c
    1.17 +===================================================================
    1.18 +--- uClibc-0.9.30.1.orig/libc/stdlib/stdlib.c
    1.19 ++++ uClibc-0.9.30.1/libc/stdlib/stdlib.c
    1.20 +@@ -401,6 +401,9 @@
    1.21 + libc_hidden_proto(__XL_NPP(strtoull))
    1.22 + strong_alias(__XL_NPP(strtoul),__XL_NPP(strtoull))
    1.23 + libc_hidden_def(__XL_NPP(strtoull))
    1.24 ++#if !defined(L_strtoul_l)
    1.25 ++strong_alias(strtoul,strtouq)
    1.26 ++#endif
    1.27 + #endif
    1.28 + 
    1.29 + 
    1.30 +Index: uClibc-0.9.30.1/include/stdlib.h
    1.31 +===================================================================
    1.32 +--- uClibc-0.9.30.1.orig/include/stdlib.h
    1.33 ++++ uClibc-0.9.30.1/include/stdlib.h
    1.34 +@@ -203,6 +203,8 @@
    1.35 + __END_NAMESPACE_STD
    1.36 + 
    1.37 + #ifdef __USE_BSD
    1.38 ++#include <sys/types.h> /* for u_quad_t */
    1.39 ++
    1.40 + /* Convert a string to a quadword integer.  */
    1.41 + __extension__
    1.42 + extern long long int strtoq (__const char *__restrict __nptr,
    1.43 +@@ -210,7 +212,7 @@
    1.44 +      __THROW __nonnull ((1)) __wur;
    1.45 + /* Convert a string to an unsigned quadword integer.  */
    1.46 + __extension__
    1.47 +-extern unsigned long long int strtouq (__const char *__restrict __nptr,
    1.48 ++extern u_quad_t strtouq (__const char *__restrict __nptr,
    1.49 + 				       char **__restrict __endptr, int __base)
    1.50 +      __THROW __nonnull ((1)) __wur;
    1.51 + #endif /* GCC and use BSD.  */