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-2004, 2006, 2009-2014 Free Software Foundation,
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 # if HAVE_UNSIGNED_LONG_LONG_INT
34 # ifndef HAVE_DECL_STRTOULL
35 "this configure-time declaration test was not run"
37 # if !HAVE_DECL_STRTOULL
38 unsigned long long int strtoull (char const *, char **, int);
44 # if HAVE_LONG_LONG_INT
45 # ifndef HAVE_DECL_STRTOLL
46 "this configure-time declaration test was not run"
48 # if !HAVE_DECL_STRTOLL
49 long long int strtoll (char const *, char **, int);
55 # define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT
56 # define Int uintmax_t
57 # define Strtoimax strtoumax
58 # define Strtol strtoul
59 # define Strtoll strtoull
60 # define Unsigned unsigned
62 # define Have_long_long HAVE_LONG_LONG_INT
64 # define Strtoimax strtoimax
65 # define Strtol strtol
66 # define Strtoll strtoll
71 Strtoimax (char const *ptr, char **endptr, int base)
74 verify (sizeof (Int) == sizeof (Unsigned long int)
75 || sizeof (Int) == sizeof (Unsigned long long int));
77 if (sizeof (Int) != sizeof (Unsigned long int))
78 return Strtoll (ptr, endptr, base);
80 verify (sizeof (Int) == sizeof (Unsigned long int));
83 return Strtol (ptr, endptr, base);