Move xstrtol messages into gnulib domain, when --pobase is used.
[pspp] / lib / xstrtol.h
index 4df140c2effac7ac2837a61ef457781371271c60..96fc4d23e4ff6aa8619c1ff7724510660a3a6ef4 100644 (file)
@@ -24,8 +24,6 @@
 
 # include <inttypes.h>
 
-# 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_ */