summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-08-09 14:00:46 +0000
committerJim Meyering <jim@meyering.net>2003-08-09 14:00:46 +0000
commit1151e71f11aad4528f9ae7636baef5c7c61e6550 (patch)
tree15968e09fd7715543f3b24765764475acbf9920b /lib
parentb8315632af385663d63db9f627429ad66e3c0364 (diff)
downloadcoreutils-1151e71f11aad4528f9ae7636baef5c7c61e6550.tar.xz
.
Diffstat (limited to 'lib')
-rw-r--r--lib/fatal.c71
-rw-r--r--lib/fatal.h68
2 files changed, 0 insertions, 139 deletions
diff --git a/lib/fatal.c b/lib/fatal.c
deleted file mode 100644
index e6f46ec94..000000000
--- a/lib/fatal.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* FIXME: define EXIT_FAILURE */
-
-#include <stdio.h>
-
-#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
-# if __STDC__
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start(args, lastarg)
-# else
-# include <varargs.h>
-# define VA_START(args, lastarg) va_start(args)
-# endif
-#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
-
-#ifdef _LIBC
-# define program_name program_invocation_name
-#else /* not _LIBC */
-/* The calling program should define program_name and set it to the
- name of the executing program. */
-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) ();
- else
- {
- fflush (stdout);
- fprintf (stderr, "%s: ", program_name);
- }
-
-#ifdef VA_START
- VA_START (args, message);
- error (EXIT_FAILURE, errnum, message, args);
- va_end (args);
-#else
- error (EXIT_FAILURE, errnum, message, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif
-}
diff --git a/lib/fatal.h b/lib/fatal.h
deleted file mode 100644
index e12f8851f..000000000
--- a/lib/fatal.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#include "error.h"
-
-/* FIXME: this is all from ansidecl. better to simply swipe
- that file from egcs/include and include it from here. */
-
-/* Using MACRO(x,y) in cpp #if conditionals does not work with some
- older preprocessors. Thus we can't define something like this:
-
-#define HAVE_GCC_VERSION(MAJOR, MINOR) \
- (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
-
-and then test "#if HAVE_GCC_VERSION(2,7)".
-
-So instead we use the macro below and test it against specific values. */
-
-/* This macro simplifies testing whether we are using gcc, and if it
- is of a particular minimum version. (Both major & minor numbers are
- significant.) This macro will evaluate to 0 if we are not using
- gcc at all. */
-#ifndef GCC_VERSION
-# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
-#endif /* GCC_VERSION */
-
-/* Define macros for some gcc attributes. This permits us to use the
- macros freely, and know that they will come into play for the
- version of gcc in which they are supported. */
-
-#if (GCC_VERSION < 2007)
-# define __attribute__(x)
-#endif
-
-/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
-#ifndef ATTRIBUTE_MALLOC
-# if (GCC_VERSION >= 2096)
-# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-# else
-# define ATTRIBUTE_MALLOC
-# endif /* GNUC >= 2.96 */
-#endif /* ATTRIBUTE_MALLOC */
-
-/* Attributes on labels were valid as of gcc 2.93. */
-#ifndef ATTRIBUTE_UNUSED_LABEL
-# if (GCC_VERSION >= 2093)
-# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
-# else
-# define ATTRIBUTE_UNUSED_LABEL
-# endif /* GNUC >= 2.93 */
-#endif /* ATTRIBUTE_UNUSED_LABEL */
-
-#ifndef ATTRIBUTE_UNUSED
-# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#endif /* ATTRIBUTE_UNUSED */
-
-#ifndef ATTRIBUTE_NORETURN
-# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif /* ATTRIBUTE_NORETURN */
-
-#ifndef ATTRIBUTE_PRINTF
-# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
-# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
-# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
-# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
-# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
-# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
-#endif /* ATTRIBUTE_PRINTF */
-
-extern void fatal (int errnum, const char *format, ...)
- ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;