[git commit 0_9_30] - Add strtouq alias (to strtoul) for 64bit

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sat Oct 10 16:44:02 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=a7cd0cf2a31493506795528125a1d87428b67374
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/0_9_30

The strtouq alias was only available on 32bit, breaking compilation of stuff
using strtouq on 64bit machines. At the same time use the correct return
type (u_quad_t).

Signed-of-by: Peter Korsgaard <jacmet at sunsite.dk>

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 include/stdlib.h     |    4 +++-
 libc/stdlib/stdlib.c |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/stdlib.h b/include/stdlib.h
index b87dfd9..cb42583 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -203,6 +203,8 @@ extern unsigned long int strtoul (__const char *__restrict __nptr,
 __END_NAMESPACE_STD
 
 #ifdef __USE_BSD
+#include <sys/types.h> /* for u_quad_t */
+
 /* Convert a string to a quadword integer.  */
 __extension__
 extern long long int strtoq (__const char *__restrict __nptr,
@@ -210,7 +212,7 @@ extern long long int strtoq (__const char *__restrict __nptr,
      __THROW __nonnull ((1)) __wur;
 /* Convert a string to an unsigned quadword integer.  */
 __extension__
-extern unsigned long long int strtouq (__const char *__restrict __nptr,
+extern u_quad_t strtouq (__const char *__restrict __nptr,
 				       char **__restrict __endptr, int __base)
      __THROW __nonnull ((1)) __wur;
 #endif /* GCC and use BSD.  */
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index 3c74be7..ecf483f 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -401,6 +401,9 @@ extern __typeof(__XL_NPP(strtoul)) __XL_NPP(strtoull);
 libc_hidden_proto(__XL_NPP(strtoull))
 strong_alias(__XL_NPP(strtoul),__XL_NPP(strtoull))
 libc_hidden_def(__XL_NPP(strtoull))
+#if !defined(L_strtoul_l)
+strong_alias(strtoul,strtouq)
+#endif
 #endif
 
 
-- 
1.6.3.3



More information about the uClibc-cvs mailing list