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 | |
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
-rw-r--r-- | config_host/config_global.h.in | 3 | ||||
-rw-r--r-- | configure.ac | 27 | ||||
-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 | ||||
-rw-r--r-- | cppuhelper/inc/cppuhelper/propertysetmixin.hxx | 6 | ||||
-rw-r--r-- | fpicker/source/aqua/FilterHelper.mm | 12 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaFilePicker.mm | 6 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaPicker.mm | 6 | ||||
-rw-r--r-- | idlc/source/scanner.l | 6 | ||||
-rw-r--r-- | l10ntools/source/cfglex.l | 6 | ||||
-rw-r--r-- | l10ntools/source/srclex.l | 6 | ||||
-rw-r--r-- | l10ntools/source/xrmlex.l | 6 | ||||
-rw-r--r-- | rsc/source/parser/rscyacc.y | 10 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/NeonUri.cxx | 9 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/DataFlavorMapping.cxx | 9 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/aquaprintaccessoryview.mm | 10 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salatslayout.cxx | 9 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx | 8 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salgdi.cxx | 8 |
20 files changed, 84 insertions, 77 deletions
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in index 87033db7f066..fa37a17d010c 100644 --- a/config_host/config_global.h.in +++ b/config_host/config_global.h.in @@ -32,6 +32,9 @@ Any change in this header will cause a rebuild of almost everything. #define HAVE_GCC_BUILTIN_ATOMIC 0 #endif +#define HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY 0 +#define HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE 0 + #undef HAVE_SFINAE_ANONYMOUS_BROKEN #ifndef HAVE_SFINAE_ANONYMOUS_BROKEN #define HAVE_SFINAE_ANONYMOUS_BROKEN 0 diff --git a/configure.ac b/configure.ac index 898dedb0523b..a12018a4ae8a 100644 --- a/configure.ac +++ b/configure.ac @@ -5562,6 +5562,33 @@ if test "$GCC" = "yes"; then AC_MSG_RESULT([no]) fi + AC_MSG_CHECKING( + [whether $CC supports pragma GCC diagnostic error/ignored/warning]) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror -Wunused" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ + #pragma GCC diagnostic ignored "-Wunused" + static void dummy() {} + ])], [ + AC_DEFINE([HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY],[1]) + AC_MSG_RESULT([yes]) + ], [AC_MSG_RESULT([no])]) + CFLAGS=$save_CFLAGS + + AC_MSG_CHECKING([whether $CC supports pragma GCC diagnostic push/pop]) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror -Wunused" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused" + static void dummy() {} + #pragma GCC diagnostic pop + ])], [ + AC_DEFINE([HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE],[1]) + AC_MSG_RESULT([yes]) + ], [AC_MSG_RESULT([no])]) + CFLAGS=$save_CFLAGS + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if __GNUC__ == 4 && __GNUC_MINOR__ == 7 && (__GNUC_PATCHLEVEL__ == 0 || __GNUC_PATCHLEVEL__ == 1) #else 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 diff --git a/cppuhelper/inc/cppuhelper/propertysetmixin.hxx b/cppuhelper/inc/cppuhelper/propertysetmixin.hxx index 68c9855689d9..bbca3ac479ee 100644 --- a/cppuhelper/inc/cppuhelper/propertysetmixin.hxx +++ b/cppuhelper/inc/cppuhelper/propertysetmixin.hxx @@ -77,7 +77,8 @@ template< typename T > class PropertySetMixin; @since UDK 3.2.1 */ -#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" #endif @@ -397,7 +398,8 @@ private: void checkUnknown(rtl::OUString const & propertyName); }; -#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 #endif 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 <functional> #include <algorithm> #include <osl/mutex.hxx> @@ -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 <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> @@ -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 <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <cppuhelper/interfacecontainer.h> @@ -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); diff --git a/idlc/source/scanner.l b/idlc/source/scanner.l index 4c123ea8f0c3..166c281fefd1 100644 --- a/idlc/source/scanner.l +++ b/idlc/source/scanner.l @@ -23,6 +23,8 @@ * scanner.ll - Lexical scanner for IDLC 1.0 */ +#include "sal/config.h" + #include <ctype.h> #include <stdlib.h> #include <string.h> @@ -247,11 +249,9 @@ static void parseLineAndFile(sal_Char* pBuf) } // Suppress any warnings from generated code: -#if defined __GNUC__ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-label" -#endif #elif defined __SUNPRO_CC #pragma disable_warn #elif defined _MSC_VER diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l index e8e6b1ab24d0..ea9e7b4178e6 100644 --- a/l10ntools/source/cfglex.l +++ b/l10ntools/source/cfglex.l @@ -21,6 +21,8 @@ * lexer for parsing cfg source files */ +#include "sal/config.h" + /* enlarge token buffer to tokenize whole strings */ #undef YYLMAX #define YYLMAX 64000 @@ -40,11 +42,9 @@ #include "sal/main.h" -#if defined __GNUC__ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-label" -#endif #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif diff --git a/l10ntools/source/srclex.l b/l10ntools/source/srclex.l index 755b0b382008..6716b1b9a704 100644 --- a/l10ntools/source/srclex.l +++ b/l10ntools/source/srclex.l @@ -22,6 +22,8 @@ * lexer for parsing resource source files (*.src) */ +#include "sal/config.h" + /* enlarge token buffer to tokenize whole strings */ #undef YYLMAX #define YYLMAX 64000 @@ -41,11 +43,9 @@ #include "sal/main.h" -#if defined __GNUC__ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-label" -#endif #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l index ad5b9490c097..7513edd6cab1 100644 --- a/l10ntools/source/xrmlex.l +++ b/l10ntools/source/xrmlex.l @@ -21,6 +21,8 @@ * lexer for parsing xml-property source files (*.xml) */ +#include "sal/config.h" + /* enlarge token buffer to tokenize whole strings */ #undef YYLMAX #define YYLMAX 64000 @@ -40,11 +42,9 @@ #include "sal/main.h" -#if defined __GNUC__ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-label" -#endif #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y index d0be59ede316..16d2833f53ac 100644 --- a/rsc/source/parser/rscyacc.y +++ b/rsc/source/parser/rscyacc.y @@ -18,6 +18,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + #include <stdio.h> #include <ctype.h> #include <string.h> @@ -256,14 +258,8 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop ) #pragma warning(push, 1) #pragma warning(disable:4129 4273 4701 4702) #endif -#if defined __GNUC__ -#define GCC_VERSION (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) -/* Diagnostics pragma was introduced with gcc-4.2.1 */ -#if GCC_VERSION >= 40201 +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic ignored "-Wwrite-strings" -#endif #elif defined __SUNPRO_CC #pragma disable_warn #endif diff --git a/ucb/source/ucp/webdav-neon/NeonUri.cxx b/ucb/source/ucp/webdav-neon/NeonUri.cxx index 5886429d2089..e578ccfc4691 100644 --- a/ucb/source/ucp/webdav-neon/NeonUri.cxx +++ b/ucb/source/ucp/webdav-neon/NeonUri.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include "sal/config.h" #include <string.h> #include <rtl/uri.hxx> @@ -45,15 +46,9 @@ using namespace webdav_ucp; # pragma disable_warn # endif -#if defined __GNUC__ -#define GCC_VERSION (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) -/* Diagnostics pragma was introduced with gcc-4.2.1 */ -#if GCC_VERSION >= 40201 +#if HAVE_GCC_PRAGMA_DIAGNOSTIC_MODIFY #pragma GCC diagnostic ignored "-Wwrite-strings" #endif -#endif namespace { diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx index 9de4038282c6..23dbfd4513fb 100644 --- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx +++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" + #include <DataFlavorMapping.hxx> #include "HtmlFmtFlt.hxx" #include "PictToBmpFlt.hxx" @@ -97,14 +99,9 @@ namespace // private // Make deprecation warnings just warnings even in a -Werror // compilation. -#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" #endif -#endif /* At the moment it appears as if only MS Office pastes "public.html" to the clipboard. */ diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm index 67714ba3eabe..8d6f5219eed4 100644 --- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm +++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" #include "tools/resary.hxx" @@ -1099,15 +1100,10 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO // Make deprecation warnings just warnings in a -Werror compilation. -#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 push #pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif -#endif @implementation AquaPrintAccessoryView +(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState @@ -1394,9 +1390,7 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO return pCtrlTarget; } -#if defined LIBO_WERROR && defined __GNUC__ && GCC_VERSION >= 40201 // #pragma GCC diagnostic pop -#endif @end diff --git a/vcl/aqua/source/gdi/atsui/salatslayout.cxx b/vcl/aqua/source/gdi/atsui/salatslayout.cxx index b2f6a04dffad..dbe507afae50 100644 --- a/vcl/aqua/source/gdi/atsui/salatslayout.cxx +++ b/vcl/aqua/source/gdi/atsui/salatslayout.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#incldue "sal/config.h" + #include "tools/debug.hxx" #include "aqua/saldata.hxx" @@ -29,14 +31,9 @@ #include <math.h> // ATSUI is deprecated in 10.6 (or already 10.5?) -#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" #endif -#endif // ======================================================================= diff --git a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx index 502c33bbd502..1dae840c79b1 100644 --- a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx +++ b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" #include <boost/assert.hpp> #include <vector> @@ -29,14 +30,9 @@ #include "aqua/atsui/salatsuifontutils.hxx" // ATSUI is deprecated in 10.6 (or already 10.5?) -#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" #endif -#endif // we have to get the font attributes from the name table // since neither head's macStyle nor OS/2's panose are easily available diff --git a/vcl/aqua/source/gdi/atsui/salgdi.cxx b/vcl/aqua/source/gdi/atsui/salgdi.cxx index 9c9eb9d0fe0f..d0594b598098 100644 --- a/vcl/aqua/source/gdi/atsui/salgdi.cxx +++ b/vcl/aqua/source/gdi/atsui/salgdi.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "sal/config.h" #include "osl/file.hxx" #include "osl/process.h" @@ -52,14 +53,9 @@ typedef std::vector<unsigned char> ByteVector; // ATSUI is deprecated in 10.6 (or already 10.5?) -#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" #endif -#endif // ======================================================================= |