diff lib-src/ellcc.c @ 1743:543769b89fed

[xemacs-hg @ 2003-10-14 05:02:57 by james] New compiler.h contains compiler-specific defines. Use it everywhere.
author james
date Tue, 14 Oct 2003 05:03:13 +0000
parents 9fc738581a9d
children 854c88538753
line wrap: on
line diff
--- a/lib-src/ellcc.c	Mon Oct 13 18:53:24 2003 +0000
+++ b/lib-src/ellcc.c	Tue Oct 14 05:03:13 2003 +0000
@@ -78,27 +78,7 @@
 
 #include <emodules.h>
 #include <ellcc.h> /* Generated files must be included using <...> */
-
-#ifndef ATTRIBUTE_MALLOC
-# if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__==2 && __GNUC_MINOR__>=96))
-#  define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-# else
-#  define ATTRIBUTE_MALLOC
-# endif /* GCC version >= 2.96 */
-#endif /* ATTRIBUTE_MALLOC */
-
-#ifdef __GNUC_
-# define ATTRIBUTE_FATAL __attribute__ ((noreturn, format (printf, 1, 2)))
-#else
-# define ATTRIBUTE_FATAL
-#endif /* __GNUC__ */
-
-#if defined(__GNUC__) && (__GNUC__ >= 2 || (__GNUC__==2 && __GNUC_MINOR__>=5))
-# define ATTRIBUTE_CONST __attribute__ ((const))
-#else
-# define ATTRIBUTE_CONST
-#endif
-
+#include "compiler.h"
 
 #ifndef HAVE_SHLIB
 int
@@ -188,7 +168,7 @@
 static void *xmalloc (size_t size) ATTRIBUTE_MALLOC;
 static void *xrealloc (void *ptr, size_t size) ATTRIBUTE_MALLOC;
 static char *xstrdup (char *) ATTRIBUTE_MALLOC;
-static void fatal (char *, ...) ATTRIBUTE_FATAL;
+static DECLARE_DOESNT_RETURN (fatal (char *, ...)) PRINTF_ARGS (1, 2);
 static char ** add_string (char **, char *);
 static char ** add_to_argv (char **, const char *);
 static char ** do_compile_mode (void);
@@ -467,7 +447,7 @@
 }
 
 /* Print error message and exit.  */
-static void
+static DOESNT_RETURN
 fatal (char *format, ...)
 {
   va_list ap;