From: Martin Liska Date: Mon, 9 May 2022 11:59:37 +0000 (+0200) Subject: ansidecl.h: sync from GCC X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35e48b6ee0b244625188f11b27808cefbeeb7666;p=binutils-gdb.git ansidecl.h: sync from GCC include/ChangeLog: * ansidecl.h: Sync from GCC. --- diff --git a/include/ansidecl.h b/include/ansidecl.h index 75bc24c8c07..efee5b6904b 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -62,7 +62,6 @@ So instead we use the macro below and test it against specific values. */ #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) #endif /* GCC_VERSION */ -#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) /* All known AIX compilers implement these things (but don't always define __STDC__). The RISC/OS MIPS compiler defines these things in SVR4 mode, but does not define __STDC__. */ @@ -79,7 +78,7 @@ So instead we use the macro below and test it against specific values. */ /* inline requires special treatment; it's in C99, and GCC >=2.7 supports it too, but it's not in C89. */ #undef inline -#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__)) +#if (!defined(__cplusplus) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__)) /* it's a keyword */ #else # if GCC_VERSION >= 2007 @@ -89,22 +88,6 @@ So instead we use the macro below and test it against specific values. */ # endif #endif -#else /* Not ANSI C. */ - -#define PTR char * - -/* some systems define these in header files for non-ansi mode */ -#undef const -#undef volatile -#undef signed -#undef inline -#define const -#define volatile -#define signed -#define inline - -#endif /* ANSI C. */ - /* 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. */ @@ -356,7 +339,7 @@ So instead we use the macro below and test it against specific values. */ #define ENUM_BITFIELD(TYPE) unsigned int #endif -#if __cpp_constexpr >= 200704 +#if defined(__cplusplus) && __cpp_constexpr >= 200704 #define CONSTEXPR constexpr #else #define CONSTEXPR @@ -419,7 +402,7 @@ So instead we use the macro below and test it against specific values. */ so that most attempts at copy are caught at compile-time. */ -#if __cplusplus >= 201103 +#if defined(__cplusplus) && __cplusplus >= 201103 #define DISABLE_COPY_AND_ASSIGN(TYPE) \ TYPE (const TYPE&) = delete; \ void operator= (const TYPE &) = delete