patches/uClibc/0.9.30.1/150-64bit-strtouq.patch
author Remy Bohmer <linux@bohmer.net>
Sun Jul 11 22:23:34 2010 +0200 (2010-07-11)
changeset 2021 3e52a1510f87
permissions -rw-r--r--
debug/gdb: Fix compilation for Mingw hosts

GDB requires PDcurses instead of ncurses while running on Windows.
So, do not always compile ncurses in case GDB needs to build.

PDcurses is provided by an earlier build step and is not described in
this file.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
[yann.morin.1998@anciense.nib.fr: we already have a way to detect ncurses usage]
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.  */