5 # define __xstrtol xstrtoul
6 # define __strtol strtoul
7 # define __unsigned unsigned
8 # define __ZLONG_MAX ULONG_MAX
10 # define __xstrtol xstrtol
11 # define __strtol strtol
12 # define __unsigned /* empty */
13 # define __ZLONG_MAX LONG_MAX
17 #if defined (__STDC__) && __STDC__
25 LONGINT_OK
, LONGINT_INVALID
, LONGINT_INVALID_SUFFIX_CHAR
, LONGINT_OVERFLOW
27 typedef enum strtol_error strtol_error
;
30 __xstrtol
__P ((const char *s
, char **ptr
, int base
,
31 __unsigned
long int *val
, const char *valid_suffixes
));
33 #define _STRTOL_ERROR(exit_code, str, argument_type_string, err) \
41 case LONGINT_INVALID: \
42 error ((exit_code), 0, "invalid %s `%s'", \
43 (argument_type_string), (str)); \
46 case LONGINT_INVALID_SUFFIX_CHAR: \
47 error ((exit_code), 0, "invalid character following %s `%s'", \
48 (argument_type_string), (str)); \
51 case LONGINT_OVERFLOW: \
52 /* FIXME: make this message dependent on STRING_TO_UNSIGNED */\
53 error ((exit_code), 0, "%s `%s' larger than maximum long int",\
54 (argument_type_string), (str)); \
60 #define STRTOL_FATAL_ERROR(str, argument_type_string, err) \
61 _STRTOL_ERROR (2, str, argument_type_string, err)
63 #define STRTOL_FAIL_WARN(str, argument_type_string, err) \
64 _STRTOL_ERROR (0, str, argument_type_string, err)
66 #endif /* _xstrtol_h_ */