blob: 52696630b1a89b3073c39a588450db04a9ccb23f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
From cb7474c898b4c3aaee898231b1ea968adc2ad95e Mon Sep 17 00:00:00 2001
From: Natanael Copa <natanael.copa@gmail.com>
Date: Fri, 26 Nov 2010 14:43:12 +0000
Subject: [PATCH] libc: fix strtoq
strtoq should always return a quad_t and be an alias of strtol on
64 bit and strtoll on 32 bit.
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
---
include/stdlib.h | 2 +-
libc/stdlib/stdlib.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/include/stdlib.h b/include/stdlib.h
index ce92ccd..300edf0 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -214,7 +214,7 @@ __END_NAMESPACE_STD
/* Convert a string to a quadword integer. */
__extension__
-extern long long int strtoq (__const char *__restrict __nptr,
+extern quad_t strtoq (__const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__THROW __nonnull ((1)) __wur;
/* Convert a string to an unsigned quadword integer. */
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index ad0c4aa..4d608ee 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -342,6 +342,9 @@ extern __typeof(__XL_NPP(strtol)) __XL_NPP(strtoll);
libc_hidden_proto(__XL_NPP(strtoll))
strong_alias(__XL_NPP(strtol),__XL_NPP(strtoll))
libc_hidden_def(__XL_NPP(strtoll))
+#if !defined(L_strtol_l)
+strong_alias(strtol,strtoq)
+#endif
#endif
#endif
--
1.7.3.2
|