summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/gansidecl.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/gansidecl.h')
-rw-r--r--contrib/gcc/gansidecl.h86
1 files changed, 40 insertions, 46 deletions
diff --git a/contrib/gcc/gansidecl.h b/contrib/gcc/gansidecl.h
index 4f4bb42..cf7762f 100644
--- a/contrib/gcc/gansidecl.h
+++ b/contrib/gcc/gansidecl.h
@@ -1,5 +1,5 @@
/* ANSI and traditional C compatibility macros.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -22,38 +22,51 @@ Boston, MA 02111-1307, USA. */
in binutils and gdb releases.
??? Over time the two should be merged into one. */
-#ifndef ANSIDECL_H
-#define ANSIDECL_H
-
-/* Add prototype support. */
-#ifndef PROTO
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define PROTO(ARGS) ARGS
-#else
-#define PROTO(ARGS) ()
-#endif
-#endif
-
-#ifndef VPROTO
-#ifdef __STDC__
-#define PVPROTO(ARGS) ARGS
-#define VPROTO(ARGS) ARGS
-#define VA_START(va_list,var) va_start(va_list,var)
-#else
-#define PVPROTO(ARGS) ()
-#define VPROTO(ARGS) (va_alist) va_dcl
-#define VA_START(va_list,var) va_start(va_list)
-#endif
-#endif
+#ifndef __GANSIDECL_H__
+#define __GANSIDECL_H__
+
+#include "ansidecl.h"
+
+/* Undef ansidecl.h's "obsolete" version. */
+#undef PROTO
+/* These macros are deprecated, use ansidecl.h's PARAMS style instead. */
+#define PROTO(ARGS) PARAMS(ARGS)
+#define VPROTO(ARGS) VPARAMS(ARGS)
+#define PVPROTO(ARGS) PARAMS(ARGS)
+
+/* Autoconf will possibly define the `inline' or `const' keywords as
+ macros, however this is only valid for the stage1 compiler. If we
+ detect a modern version of gcc, unconditionally reset the values.
+ This makes sure the right thing happens in stage2 and later. We
+ need to do this very early; i.e. before any systems header files or
+ gcc header files in case they use these keywords. Otherwise
+ conflicts might occur. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# undef const
+# undef inline
+# define inline __inline__ /* Modern gcc can use `__inline__' freely. */
+#endif /* GCC >= 2.7 */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __attribute__(x)
#endif
+#ifndef ATTRIBUTE_UNUSED_LABEL
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 93)
+# define ATTRIBUTE_UNUSED_LABEL
+# else
+# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
+# 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)
@@ -63,29 +76,10 @@ Boston, MA 02111-1307, USA. */
#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
#endif /* ATTRIBUTE_PRINTF */
-#ifndef GENERIC_PTR
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define GENERIC_PTR void *
-#else
-#define GENERIC_PTR char *
-#endif
-#endif
+#define GENERIC_PTR PTR
#ifndef NULL_PTR
-#define NULL_PTR ((GENERIC_PTR) 0)
-#endif
-
-#ifdef __STDC__
-
-#define PTR void *
-
-#else
-
-#define PTR char *
-#ifndef const
-#define const
+#define NULL_PTR ((PTR) 0)
#endif
-#endif /* ! __STDC__ */
-
-#endif /* ANSIDECL_H */
+#endif /* __GANSIDECL_H__ */
OpenPOWER on IntegriCloud