From fc902df07cf4ffd74ff3c4b89e981fc2aae2f592 Mon Sep 17 00:00:00 2001 From: leper Date: Sat, 24 Jan 2015 20:37:07 +0000 Subject: [PATCH] Remove checks for unsupported GCC versions (<4.6). This was SVN commit r16224. --- source/collada/DLL.h | 10 ++++------ source/lib/code_annotation.h | 12 ++++++------ source/lib/sysdep/os/osx/osx.cpp | 17 ++++------------- source/scriptinterface/ScriptExtraHeaders.h | 6 +----- source/third_party/mikktspace/mikktspace.cpp | 8 ++------ source/third_party/mongoose/mongoose.cpp | 12 +++--------- .../tools/atlas/AtlasObject/JSONSpiritInclude.h | 15 +++++---------- source/tools/atlas/AtlasUI/Misc/precompiled.h | 17 ++++++++--------- 8 files changed, 33 insertions(+), 64 deletions(-) diff --git a/source/collada/DLL.h b/source/collada/DLL.h index 95cad93ad6..da309ff3bb 100644 --- a/source/collada/DLL.h +++ b/source/collada/DLL.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2015 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,12 +24,10 @@ # else # define EXPORT extern "C" __declspec(dllimport) # endif +#elif defined(__GNUC__) +# define EXPORT extern "C" __attribute__ ((visibility ("default"))) #else -# if __GNUC__ >= 4 -# define EXPORT extern "C" __attribute__ ((visibility ("default"))) -# else -# define EXPORT extern "C" -# endif +# define EXPORT extern "C" #endif #define LOG_INFO 0 diff --git a/source/lib/code_annotation.h b/source/lib/code_annotation.h index b8bb6d8adc..6885b9fc58 100644 --- a/source/lib/code_annotation.h +++ b/source/lib/code_annotation.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Wildfire Games +/* Copyright (c) 2015 Wildfire Games * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -70,7 +70,7 @@ * NOTHROW_DECLARE void function(); * NOTHROW_DEFINE void function() {} **/ -#if GCC_VERSION >= 303 +#if GCC_VERSION # define NOTHROW_DECLARE __attribute__((nothrow)) # define NOTHROW_DEFINE // not supported for definitions #elif MSC_VERSION @@ -121,7 +121,7 @@ #define HAVE_ASSUME_UNREACHABLE 1 #if MSC_VERSION && !ICC_VERSION // (ICC ignores this) # define ASSUME_UNREACHABLE __assume(0) -#elif GCC_VERSION >= 450 +#elif GCC_VERSION # define ASSUME_UNREACHABLE __builtin_unreachable() #else # define ASSUME_UNREACHABLE @@ -327,10 +327,10 @@ template char (*ArraySizeDeducer(T (&)[n]))[n]; // C99-style __func__ // .. newer GCC already have it -#if GCC_VERSION >= 300 +#if GCC_VERSION // nothing need be done -// .. old GCC and MSVC have __FUNCTION__ -#elif GCC_VERSION >= 200 || MSC_VERSION +// .. MSVC have __FUNCTION__ +#elif MSC_VERSION # define __func__ __FUNCTION__ // .. unsupported #else diff --git a/source/lib/sysdep/os/osx/osx.cpp b/source/lib/sysdep/os/osx/osx.cpp index 6da99db7b1..f0a538bd88 100644 --- a/source/lib/sysdep/os/osx/osx.cpp +++ b/source/lib/sysdep/os/osx/osx.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014 Wildfire Games +/* Copyright (c) 2015 Wildfire Games * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -35,12 +35,8 @@ #include // _NSGetExecutablePath // Ignore deprecation warnings for 10.5 backwards compatibility -#if GCC_VERSION >= 402 // (older GCCs don't support this pragma) -# if GCC_VERSION >= 406 // store user flags -# pragma GCC diagnostic push -# endif -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" Status sys_clipboard_set(const wchar_t* text) { @@ -187,9 +183,4 @@ OsPath sys_ExecutablePathname() return path; } -#if GCC_VERSION >= 402 -# pragma GCC diagnostic warning "-Wdeprecated-declarations" -# if GCC_VERSION >= 406 -# pragma GCC diagnostic pop // restore user flags -# endif -#endif +#pragma GCC diagnostic pop // restore user flags diff --git a/source/scriptinterface/ScriptExtraHeaders.h b/source/scriptinterface/ScriptExtraHeaders.h index 8da2cc2ee8..d37f7bb6b5 100644 --- a/source/scriptinterface/ScriptExtraHeaders.h +++ b/source/scriptinterface/ScriptExtraHeaders.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Wildfire Games. +/* Copyright (C) 2015 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -52,10 +52,6 @@ # pragma warning(pop) #endif #if GCC_VERSION -# pragma GCC diagnostic warning "-Wunused-parameter" -# pragma GCC diagnostic warning "-Wredundant-decls" -# pragma GCC diagnostic warning "-Wnon-virtual-dtor" -// restore user flags and re-enable the warnings disabled a few lines above # pragma GCC diagnostic pop #endif diff --git a/source/third_party/mikktspace/mikktspace.cpp b/source/third_party/mikktspace/mikktspace.cpp index f2618ed423..dfde9b3194 100644 --- a/source/third_party/mikktspace/mikktspace.cpp +++ b/source/third_party/mikktspace/mikktspace.cpp @@ -10,12 +10,8 @@ # pragma warning(disable:4189) // local variable is initialized but not referenced #endif -#if defined(__GNUC__) -# define GCC_VERSION (__GNUC__*100 + __GNUC_MINOR__) - -# if GCC_VERSION >= 402 // older GCCs don't support the diagnostic pragma at all -# pragma GCC diagnostic ignored "-Wunused-variable" -# endif +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wunused-variable" #endif /** \file mikktspace/mikktspace.c diff --git a/source/third_party/mongoose/mongoose.cpp b/source/third_party/mongoose/mongoose.cpp index 9629da4435..0e0f2ee743 100644 --- a/source/third_party/mongoose/mongoose.cpp +++ b/source/third_party/mongoose/mongoose.cpp @@ -22,15 +22,9 @@ # pragma comment(lib, "ws2_32.lib") #endif -#if defined(__GNUC__) -# define GCC_VERSION (__GNUC__*100 + __GNUC_MINOR__) - -# if GCC_VERSION >= 402 // older GCCs don't support the diagnostic pragma at all -# pragma GCC diagnostic ignored "-Wunused-function" -# endif -# if GCC_VERSION >= 406 // new warning in 4.6 -# pragma GCC diagnostic ignored "-Wunused-but-set-variable" -# endif +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wunused-function" +# pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif #define NO_CGI diff --git a/source/tools/atlas/AtlasObject/JSONSpiritInclude.h b/source/tools/atlas/AtlasObject/JSONSpiritInclude.h index 4d4f7131aa..2635d87d7a 100644 --- a/source/tools/atlas/AtlasObject/JSONSpiritInclude.h +++ b/source/tools/atlas/AtlasObject/JSONSpiritInclude.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Wildfire Games. +/* Copyright (C) 2015 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -20,12 +20,7 @@ #define JSON_SPIRIT_INCLUDE_H #ifdef __GNUC__ -# define GCC_VERSION (__GNUC__*100 + __GNUC_MINOR__) -#else -# define GCC_VERSION 0 -#endif - -#if GCC_VERSION >= 402 // (older GCCs don't support this pragma) +# pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-parameter" #endif @@ -42,8 +37,8 @@ #pragma warning(default: 4512) #endif -#if GCC_VERSION >= 402 -# pragma GCC diagnostic warning "-Wunused-parameter" +#ifdef __GNUC__ +# pragma GCC diagnostic pop #endif -#endif // JSON_SPIRIT_INCLUDE_H \ No newline at end of file +#endif // JSON_SPIRIT_INCLUDE_H diff --git a/source/tools/atlas/AtlasUI/Misc/precompiled.h b/source/tools/atlas/AtlasUI/Misc/precompiled.h index 5863e2df7b..5f4f6466db 100644 --- a/source/tools/atlas/AtlasUI/Misc/precompiled.h +++ b/source/tools/atlas/AtlasUI/Misc/precompiled.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Wildfire Games. +/* Copyright (C) 2015 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -39,7 +39,8 @@ # define WIN32_LEAN_AND_MEAN #endif -#if defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__) >= 402 // (older GCCs don't support this pragma) +#ifdef __GNUC__ +# pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wredundant-decls" // triggered by wx/geometry.h #endif @@ -72,8 +73,8 @@ #include "wx/wfstream.h" #include "wx/zstream.h" -#if defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__) >= 402 -# pragma GCC diagnostic warning "-Wredundant-decls" // re-enable +#ifdef __GNUC__ +# pragma GCC diagnostic pop #endif #include @@ -109,12 +110,10 @@ #ifdef _WIN32 # define ATLASDLLIMPEXP extern "C" __declspec(dllexport) +#elif defined(__GNUC__) +# define ATLASDLLIMPEXP extern "C" __attribute__ ((visibility ("default"))) #else -# if __GNUC__ >= 4 -# define ATLASDLLIMPEXP extern "C" __attribute__ ((visibility ("default"))) -# else -# define ATLASDLLIMPEXP extern "C" -# endif +# define ATLASDLLIMPEXP extern "C" #endif // Abort with an obvious message if wx isn't Unicode, instead of complaining