summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-03-25 20:28:19 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-03-25 20:28:19 +0000
commit6886887bc86e99d4db9befb7881be804fa758312 (patch)
tree5c36b3d4fe3e8dc5f75a058d29a48a2ecbcd5afc
parent8b49628cd458f9a87e376e75ee4a24373842f945 (diff)
- Add strtouq alias (to strtoul) for 64bit
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@sunsite.dk>
-rw-r--r--include/stdlib.h4
-rw-r--r--libc/stdlib/stdlib.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 124dc7329..52f02e4fd 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -209,6 +209,8 @@ libc_hidden_proto(strtoul)
__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,
@@ -216,7 +218,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 ef92ea4fd..05cc68bdb 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