1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Convert string representation of a number into an intmax_t value.
5 Copyright (C) 1999, 2001, 2002, 2003, 2004, 2006, 2009, 2010 Free Software
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* Written by Paul Eggert. */
25 /* Verify interface. */
33 # ifndef HAVE_DECL_STRTOULL
34 "this configure-time declaration test was not run"
36 # if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG_INT
37 unsigned long long int strtoull (char const *, char **, int);
42 # ifndef HAVE_DECL_STRTOLL
43 "this configure-time declaration test was not run"
45 # if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG_INT
46 long long int strtoll (char const *, char **, int);
51 # define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT
52 # define Int uintmax_t
53 # define Unsigned unsigned
54 # define strtoimax strtoumax
55 # define strtol strtoul
56 # define strtoll strtoull
58 # define Have_long_long HAVE_LONG_LONG_INT
64 strtoimax (char const *ptr, char **endptr, int base)
67 verify (sizeof (Int) == sizeof (Unsigned long int)
68 || sizeof (Int) == sizeof (Unsigned long long int));
70 if (sizeof (Int) != sizeof (Unsigned long int))
71 return strtoll (ptr, endptr, base);
73 verify (sizeof (Int) == sizeof (Unsigned long int));
76 return strtol (ptr, endptr, base);