1 /* Convert string representation of a number into an integer value.
2 Copyright (C) 1991-2013 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
21 #include <locale/localeinfo.h>
27 # define INT unsigned LONG int
33 # define strtol wcstoull
34 # define __strtol_l __wcstoull_l
36 # define strtol wcstoul
37 # define __strtol_l __wcstoul_l
41 # define strtol strtoull
42 # define __strtol_l __strtoull_l
44 # define strtol strtoul
45 # define __strtol_l __strtoul_l
51 # define strtol wcstoll
52 # define __strtol_l __wcstoll_l
54 # define strtol wcstol
55 # define __strtol_l __wcstol_l
59 # define strtol strtoll
60 # define __strtol_l __strtoll_l
66 /* If QUAD is defined, we are defining `strtoll' or `strtoull',
67 operating on `long long int's. */
69 # define LONG long long
76 # define STRING_TYPE wchar_t
78 # define STRING_TYPE char
82 #define INTERNAL(X) INTERNAL1(X)
83 #define INTERNAL1(X) __##X##_internal
86 extern INT
INTERNAL (__strtol_l
) (const STRING_TYPE
*, STRING_TYPE
**, int,
91 INTERNAL (strtol
) (nptr
, endptr
, base
, group
)
92 const STRING_TYPE
*nptr
;
97 return INTERNAL (__strtol_l
) (nptr
, endptr
, base
, group
, _NL_CURRENT_LOCALE
);
99 libc_hidden_def (INTERNAL (strtol
))
103 strtol (nptr
, endptr
, base
)
104 const STRING_TYPE
*nptr
;
105 STRING_TYPE
**endptr
;
108 return INTERNAL (__strtol_l
) (nptr
, endptr
, base
, 0, _NL_CURRENT_LOCALE
);
110 libc_hidden_def (strtol
)