1 /* Convert string representation of a number into an integer value.
2 Copyright (C) 1991,92,94,95,96,97,98,99,2000,2001,2002,2003,2004,2007
3 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
22 #include <locale/localeinfo.h>
28 # define INT unsigned LONG int
34 # define strtol wcstoull
35 # define __strtol_l __wcstoull_l
37 # define strtol wcstoul
38 # define __strtol_l __wcstoul_l
42 # define strtol strtoull
43 # define __strtol_l __strtoull_l
45 # define strtol strtoul
46 # define __strtol_l __strtoul_l
52 # define strtol wcstoll
53 # define __strtol_l __wcstoll_l
55 # define strtol wcstol
56 # define __strtol_l __wcstol_l
60 # define strtol strtoll
61 # define __strtol_l __strtoll_l
67 /* If QUAD is defined, we are defining `strtoll' or `strtoull',
68 operating on `long long int's. */
70 # define LONG long long
77 # define STRING_TYPE wchar_t
79 # define STRING_TYPE char
83 #define INTERNAL(X) INTERNAL1(X)
84 #define INTERNAL1(X) __##X##_internal
87 extern INT
INTERNAL (__strtol_l
) (const STRING_TYPE
*, STRING_TYPE
**, int,
92 INTERNAL (strtol
) (nptr
, endptr
, base
, group
)
93 const STRING_TYPE
*nptr
;
98 return INTERNAL (__strtol_l
) (nptr
, endptr
, base
, group
, _NL_CURRENT_LOCALE
);
100 libc_hidden_def (INTERNAL (strtol
))
104 strtol (nptr
, endptr
, base
)
105 const STRING_TYPE
*nptr
;
106 STRING_TYPE
**endptr
;
109 return INTERNAL (__strtol_l
) (nptr
, endptr
, base
, 0, _NL_CURRENT_LOCALE
);
111 libc_hidden_def (strtol
)