From fa545023ada3f2a5f79cab1ff628fd18434c7c2e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 23 Mar 2013 21:55:27 +0100 Subject: 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 --- fpicker/source/aqua/FilterHelper.mm | 12 ++++-------- fpicker/source/aqua/SalAquaFilePicker.mm | 6 ++++-- fpicker/source/aqua/SalAquaPicker.mm | 6 ++++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/aqua/FilterHelper.mm b/fpicker/source/aqua/FilterHelper.mm index b076990b3f83..fd0e47b4a25d 100644 --- a/fpicker/source/aqua/FilterHelper.mm +++ b/fpicker/source/aqua/FilterHelper.mm @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + #include #include #include @@ -374,14 +376,8 @@ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno:: } // 'fileAttributesAtPath:traverseLink:' is deprecated -#if defined LIBO_WERROR && defined __GNUC__ -#define GCC_VERSION (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) -#if GCC_VERSION >= 40201 +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic warning "-Wdeprecated-declarations" -#define DID_TURN_OFF_DEPRECATED_DECLARATIONS_WARNING -#endif #endif sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename) @@ -440,7 +436,7 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename) return sal_False; } -#ifdef DID_TURN_OFF_DEPRECATED_DECLARATIONS_WARNING +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic error "-Wdeprecated-declarations" #endif diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index 119c00d7d22d..8d1d5bc42ef6 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + #include #include #include @@ -769,12 +771,12 @@ void SalAquaFilePicker::updateSaveFileNameExtension() { rtl::OUString suffix = (*(aStringList.begin())).copy(1); NSString *requiredFileType = [NSString stringWithOUString:suffix]; -#if defined(LIBO_WERROR) && defined(__clang__) && MACOSX_SDK_VERSION >= 1070 +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE #pragma GCC diagnostic push #pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif [m_pDialog setRequiredFileType:requiredFileType]; -#if defined(LIBO_WERROR) && defined(__clang__) && MACOSX_SDK_VERSION >= 1070 +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE #pragma GCC diagnostic pop #endif diff --git a/fpicker/source/aqua/SalAquaPicker.mm b/fpicker/source/aqua/SalAquaPicker.mm index 9fdc8486a38f..b4a39d46a174 100644 --- a/fpicker/source/aqua/SalAquaPicker.mm +++ b/fpicker/source/aqua/SalAquaPicker.mm @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + #include #include #include @@ -176,7 +178,7 @@ int SalAquaPicker::run() startDirectory = NSHomeDirectory(); } -#if defined(LIBO_WERROR) && defined(__clang__) && MACOSX_SDK_VERSION >= 1070 +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE #pragma GCC diagnostic push #pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif @@ -199,7 +201,7 @@ int SalAquaPicker::run() implsetDisplayDirectory([[NSURL fileURLWithPath:pDir] OUStringForInfo:FULLPATH]); } } -#if defined(LIBO_WERROR) && defined(__clang__) && MACOSX_SDK_VERSION >= 1070 +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY && HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE #pragma GCC diagnostic pop #endif DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal); -- cgit