Fix override being used on gcc 4.3 to 4.6.

This commit is contained in:
Jonathan G Rennison
2016-01-08 17:01:37 +00:00
parent 548ea31e83
commit 155987a4aa
2 changed files with 5 additions and 3 deletions

View File

@@ -1394,10 +1394,12 @@ make_compiler_cflags() {
flags="$flags -Wnon-virtual-dtor" flags="$flags -Wnon-virtual-dtor"
fi fi
if [ $cc_version -ge 43 ]; then if [ $cc_version -ge 47 ]; then
cxxflags="$cxxflags -std=gnu++11"
elif [ $cc_version -ge 43 ]; then
# Use gnu++0x mode so static_assert() is available. # Use gnu++0x mode so static_assert() is available.
# Don't use c++0x, it breaks mingw (with gcc 4.4.0). # Don't use c++0x, it breaks mingw (with gcc 4.4.0).
cxxflags="$cxxflags -std=gnu++0x" cxxflags="$cxxflags -std=gnu++0x -DDISABLE_OVERRIDE"
fi fi
if [ $cc_version -eq 45 ]; then if [ $cc_version -eq 45 ]; then

View File

@@ -521,7 +521,7 @@ static inline void free(const void *ptr)
* Use of the override keyword can prevent various types of problems when the base method signature is changed, but derived overriding methods are not * Use of the override keyword can prevent various types of problems when the base method signature is changed, but derived overriding methods are not
* This is conditional to maintain compatibility with legacy compilers * This is conditional to maintain compatibility with legacy compilers
*/ */
#if __cplusplus >= 201103L || defined(__STDCXX_VERSION__) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__) #if !defined(DISABLE_OVERRIDE) && (__cplusplus >= 201103L || defined(__STDCXX_VERSION__) || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__))
#define OVERRIDE override #define OVERRIDE override
#else #else
#define OVERRIDE #define OVERRIDE