Mention that the 'free' module, LIA-1.
[gnulib.git] / lib / fatal.c
index 430e52a..79e8a34 100644 (file)
 # include <config.h>
 #endif
 
-/* FIXME: define EXIT_FAILURE */
+#include "fatal.h"
 
+#include "exit.h"
+#include <stdarg.h>
 #include <stdio.h>
-
-#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start(args, lastarg)
-#else
-# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
-# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
-#endif
-
-#if STDC_HEADERS || _LIBC
-# include <stdlib.h>
-# include <string.h>
-#else
-void exit ();
-#endif
+#include <stdlib.h>
+#include <string.h>
 
 #ifdef _LIBC
 # define program_name program_invocation_name
@@ -47,24 +36,14 @@ void exit ();
 extern char *program_name;
 #endif
 
-#include "fatal.h"
 #include "unlocked-io.h"
 
 /* Like error, but always exit with EXIT_FAILURE.  */
 
 void
-#if defined VA_START && __STDC__
 fatal (int errnum, const char *message, ...)
-#else
-fatal (errnum, message, va_alist)
-     int errnum;
-     char *message;
-     va_dcl
-#endif
 {
-#ifdef VA_START
   va_list args;
-#endif
 
   if (error_print_progname)
     (*error_print_progname) ();
@@ -74,11 +53,10 @@ fatal (errnum, message, va_alist)
       fprintf (stderr, "%s: ", program_name);
     }
 
-#ifdef VA_START
-  VA_START (args, message);
+  va_start (args, message);
   error (EXIT_FAILURE, errnum, message, args);
+
+  /* The following code isn't reachable, but pacifies some compilers.  */
   va_end (args);
-#else
-  error (EXIT_FAILURE, errnum, message, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif
+  abort ();
 }