patches/uClibc/0.9.30.1/150-64bit-strtouq.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 17:54:21 2011 +0200 (2011-07-17)
changeset 2888 dd71df95903a
permissions -rw-r--r--
cc/gcc: pass the companion libs prefix to cc_core

In case of canadian-cross, the companion libraries are not the same for
the core cc (they run on 'build') as they are for the final cc (they run
on 'host').

Prepare for this differentiation (coming later), while retaining the
current behavior (to use the same compblibs).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1282
     1
[PATCH]: Add strtouq alias (to strtoul) for 64bit
yann@1282
     2
yann@1282
     3
The strtouq alias was only available on 32bit, breaking compilation of stuff
yann@1282
     4
using strtouq on 64bit machines. At the same time use the correct return
yann@1282
     5
type (u_quad_t).
yann@1282
     6
yann@1282
     7
Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk>
yann@1282
     8
---
yann@1282
     9
 include/stdlib.h     |    4 +++-
yann@1282
    10
 libc/stdlib/stdlib.c |    1 +
yann@1282
    11
 2 files changed, 4 insertions(+), 1 deletion(-)
yann@1282
    12
yann@1282
    13
Index: uClibc-0.9.30.1/libc/stdlib/stdlib.c
yann@1282
    14
===================================================================
yann@1282
    15
--- uClibc-0.9.30.1.orig/libc/stdlib/stdlib.c
yann@1282
    16
+++ uClibc-0.9.30.1/libc/stdlib/stdlib.c
yann@1282
    17
@@ -401,6 +401,9 @@
yann@1282
    18
 libc_hidden_proto(__XL_NPP(strtoull))
yann@1282
    19
 strong_alias(__XL_NPP(strtoul),__XL_NPP(strtoull))
yann@1282
    20
 libc_hidden_def(__XL_NPP(strtoull))
yann@1282
    21
+#if !defined(L_strtoul_l)
yann@1282
    22
+strong_alias(strtoul,strtouq)
yann@1282
    23
+#endif
yann@1282
    24
 #endif
yann@1282
    25
 
yann@1282
    26
 
yann@1282
    27
Index: uClibc-0.9.30.1/include/stdlib.h
yann@1282
    28
===================================================================
yann@1282
    29
--- uClibc-0.9.30.1.orig/include/stdlib.h
yann@1282
    30
+++ uClibc-0.9.30.1/include/stdlib.h
yann@1282
    31
@@ -203,6 +203,8 @@
yann@1282
    32
 __END_NAMESPACE_STD
yann@1282
    33
 
yann@1282
    34
 #ifdef __USE_BSD
yann@1282
    35
+#include <sys/types.h> /* for u_quad_t */
yann@1282
    36
+
yann@1282
    37
 /* Convert a string to a quadword integer.  */
yann@1282
    38
 __extension__
yann@1282
    39
 extern long long int strtoq (__const char *__restrict __nptr,
yann@1282
    40
@@ -210,7 +212,7 @@
yann@1282
    41
      __THROW __nonnull ((1)) __wur;
yann@1282
    42
 /* Convert a string to an unsigned quadword integer.  */
yann@1282
    43
 __extension__
yann@1282
    44
-extern unsigned long long int strtouq (__const char *__restrict __nptr,
yann@1282
    45
+extern u_quad_t strtouq (__const char *__restrict __nptr,
yann@1282
    46
 				       char **__restrict __endptr, int __base)
yann@1282
    47
      __THROW __nonnull ((1)) __wur;
yann@1282
    48
 #endif /* GCC and use BSD.  */