X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fxstrtol.h;h=96fc4d23e4ff6aa8619c1ff7724510660a3a6ef4;hb=c7110f3b833159c91e8cbe6a14349174aeef4ab6;hp=4df140c2effac7ac2837a61ef457781371271c60;hpb=fe32d83182dd651bbdaee9a8b6a54c6e3ad9ad2e;p=pspp diff --git a/lib/xstrtol.h b/lib/xstrtol.h index 4df140c2ef..96fc4d23e4 100644 --- a/lib/xstrtol.h +++ b/lib/xstrtol.h @@ -24,8 +24,6 @@ # include -# include "gettext.h" - # ifndef _STRTOL_ERROR enum strtol_error { @@ -56,35 +54,10 @@ _DECLARE_XSTRTOL (xstrtoumax, uintmax_t) (usually starting with one or two minus signs). ARG is the option's argument. ERR is the error code returned by one of the xstrto* functions. */ -# define _STRTOL_ERROR(Exit_code, Option, Arg, Err) \ - do \ - { \ - switch ((Err)) \ - { \ - default: \ - abort (); \ - \ - case LONGINT_INVALID: \ - error (Exit_code, 0, gettext ("invalid %s argument `%s'"), \ - Option, Arg); \ - break; \ - \ - case LONGINT_INVALID_SUFFIX_CHAR: \ - case LONGINT_INVALID_SUFFIX_CHAR | LONGINT_OVERFLOW: \ - error ((Exit_code), 0, \ - gettext ("invalid suffix in %s argument `%s'"), \ - Option, Arg); \ - break; \ - \ - case LONGINT_OVERFLOW: \ - error (Exit_code, 0, gettext ("%s argument `%s' too large"), \ - Option, Arg); \ - break; \ - } \ - } \ - while (0) +void xstrtol_error (int exit_code, char const *option, char const *arg, + strtol_error err); # define STRTOL_FATAL_ERROR(Option, Arg, Err) \ - _STRTOL_ERROR (exit_failure, Option, Arg, Err) + xstrtol_error (exit_failure, Option, Arg, Err) #endif /* not XSTRTOL_H_ */