diff options
author | Nick Clifton <nickc@redhat.com> | 2017-09-15 14:53:48 +0000 |
---|---|---|
committer | Pedro Alves <palves@gcc.gnu.org> | 2017-09-15 14:53:48 +0000 |
commit | efae2b2f9b70196b6e282a2cebb97b6f00714a36 (patch) | |
tree | 10b852d68885a942e3f6d790a8234d54cdeecf5d /include/ansidecl.h | |
parent | 870118b7f139a2477cd16de9d8539946959c5633 (diff) | |
download | gcc-efae2b2f9b70196b6e282a2cebb97b6f00714a36.zip gcc-efae2b2f9b70196b6e282a2cebb97b6f00714a36.tar.gz gcc-efae2b2f9b70196b6e282a2cebb97b6f00714a36.tar.bz2 |
Fix compile time error when using ansidecl.h with an old version of GCC.
include/
2017-07-31 Nick Clifton <nickc@redhat.com>
Binutils PR 21850
* ansidecl.h (OVERRIDE): Protect check of __cplusplus value with
#idef __cplusplus.
From-SVN: r252822
Diffstat (limited to 'include/ansidecl.h')
-rw-r--r-- | include/ansidecl.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/include/ansidecl.h b/include/ansidecl.h index f6e1761..ab3b895 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -334,22 +334,28 @@ So instead we use the macro below and test it against specific values. */ For gcc, use "-std=c++11" to enable C++11 support; gcc 6 onwards enables this by default (actually GNU++14). */ -#if __cplusplus >= 201103 -/* C++11 claims to be available: use it. final/override were only - implemented in 4.7, though. */ -# if GCC_VERSION < 4007 +#if defined __cplusplus +# if __cplusplus >= 201103 + /* C++11 claims to be available: use it. Final/override were only + implemented in 4.7, though. */ +# if GCC_VERSION < 4007 +# define OVERRIDE +# define FINAL +# else +# define OVERRIDE override +# define FINAL final +# endif +# elif GCC_VERSION >= 4007 + /* G++ 4.7 supports __final in C++98. */ # define OVERRIDE -# define FINAL +# define FINAL __final # else -# define OVERRIDE override -# define FINAL final + /* No C++11 support; leave the macros empty. */ +# define OVERRIDE +# define FINAL # endif -#elif GCC_VERSION >= 4007 -/* G++ 4.7 supports __final in C++98. */ -# define OVERRIDE -# define FINAL __final #else -/* No C++11 support; leave the macros empty: */ + /* No C++11 support; leave the macros empty. */ # define OVERRIDE # define FINAL #endif |