diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-03-23 21:55:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-03-25 08:52:54 +0100 |
commit | fa545023ada3f2a5f79cab1ff628fd18434c7c2e (patch) | |
tree | 7bb5c0f01264f9b53724baa1b0ef7b7e80e23b3d /connectivity | |
parent | c940e3d8b3895c550fb37e0e9acbd19b4bb3515e (diff) |
Introduce HAVE_GCC_PRAGMA_DIAGNOSTIC_{MODIFY,SCOPE}
...replacing hard-coded GCC version checks. Those checks that guard
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
appear relevant only for GCC itself, not Clang (which used to fail the old
guards because it typically announces itself with a rather low
__GNUC__/__GNUC_MINOR__ version), see 6e67c03dc0225fc66343546b14e902b9d238b1a3
"Enable -Wnon-virtual-dtor for GCC 4.6"
Change-Id: I6bfa4d5caa6192e7a203ce829682bf6bb8d61a1b
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/mozab/post_include_mozilla.h | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/pre_include_mozilla.h | 5 | ||||
-rw-r--r-- | connectivity/source/parse/sqlflex.l | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/connectivity/source/drivers/mozab/post_include_mozilla.h b/connectivity/source/drivers/mozab/post_include_mozilla.h index 9534b03680a6..20753f4a0e5b 100644 --- a/connectivity/source/drivers/mozab/post_include_mozilla.h +++ b/connectivity/source/drivers/mozab/post_include_mozilla.h @@ -17,7 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE \ + && !defined __clang__ #pragma GCC diagnostic pop #elif defined __SUNPRO_CC #pragma enable_warn diff --git a/connectivity/source/drivers/mozab/pre_include_mozilla.h b/connectivity/source/drivers/mozab/pre_include_mozilla.h index b59974e6010a..14a7ad6c8038 100644 --- a/connectivity/source/drivers/mozab/pre_include_mozilla.h +++ b/connectivity/source/drivers/mozab/pre_include_mozilla.h @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + #ifndef MINIMAL_PROFILEDISCOVER // Turn off DEBUG Assertions #ifdef _DEBUG @@ -46,7 +48,8 @@ #endif #endif -#if defined __GNUC__ && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE \ + && !defined __clang__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" #elif defined __SUNPRO_CC diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index d17128ec64a9..44484fe760ed 100644 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -18,6 +18,8 @@ // the License at http://www.apache.org/licenses/LICENSE-2.0 . // +#include "sal/config.h" + #define YY_EXIT 1 // YY_FATAL will not halt the application #ifndef _CSTDARG_ @@ -44,11 +46,9 @@ #include <rtl/strbuf.hxx> #include <connectivity/sqlparse.hxx> -#if defined __GNUC__ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY # pragma GCC diagnostic ignored "-Wwrite-strings" # pragma GCC diagnostic ignored "-Wunused-function" -#endif #elif defined __SUNPRO_CC #pragma disable_warn #elif defined _MSC_VER |