diff --git a/examples/DemoRunner/Builds/Android/app/CMakeLists.txt b/examples/DemoRunner/Builds/Android/app/CMakeLists.txt index 406a692338..2ca24b2b63 100644 --- a/examples/DemoRunner/Builds/Android/app/CMakeLists.txt +++ b/examples/DemoRunner/Builds/Android/app/CMakeLists.txt @@ -795,6 +795,7 @@ add_library( ${BINARY_NAME} "../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" "../../../../../modules/juce_core/streams/juce_URLInputSource.h" "../../../../../modules/juce_core/system/juce_CompilerSupport.h" + "../../../../../modules/juce_core/system/juce_CompilerWarnings.h" "../../../../../modules/juce_core/system/juce_PlatformDefs.h" "../../../../../modules/juce_core/system/juce_StandardHeader.h" "../../../../../modules/juce_core/system/juce_SystemStats.cpp" @@ -2400,6 +2401,7 @@ set_source_files_properties("../../../../../modules/juce_core/streams/juce_Subre set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerSupport.h" PROPERTIES HEADER_FILE_ONLY TRUE) +set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerWarnings.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_PlatformDefs.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_StandardHeader.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_SystemStats.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) diff --git a/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj b/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj index e1dbb1f809..2eb76a30a2 100644 --- a/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj +++ b/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj @@ -2670,6 +2670,7 @@ + diff --git a/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj.filters b/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj.filters index 86461c06f3..81006063ac 100644 --- a/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj.filters +++ b/examples/DemoRunner/Builds/VisualStudio2015/DemoRunner_App.vcxproj.filters @@ -4077,6 +4077,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj b/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj index 665a8c4307..48e8291b26 100644 --- a/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj +++ b/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj @@ -2670,6 +2670,7 @@ + diff --git a/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj.filters b/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj.filters index 6b687740aa..f9b5f9cb8d 100644 --- a/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj.filters +++ b/examples/DemoRunner/Builds/VisualStudio2017/DemoRunner_App.vcxproj.filters @@ -4077,6 +4077,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj b/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj index 695aee3a4a..b4873c703e 100644 --- a/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj +++ b/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj @@ -2670,6 +2670,7 @@ + diff --git a/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj.filters b/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj.filters index 2732bd68b9..6ee06c3dea 100644 --- a/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj.filters +++ b/examples/DemoRunner/Builds/VisualStudio2019/DemoRunner_App.vcxproj.filters @@ -4077,6 +4077,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/AudioPerformanceTest/Builds/Android/app/CMakeLists.txt b/extras/AudioPerformanceTest/Builds/Android/app/CMakeLists.txt index 305dc6858a..1d1ca5b84b 100644 --- a/extras/AudioPerformanceTest/Builds/Android/app/CMakeLists.txt +++ b/extras/AudioPerformanceTest/Builds/Android/app/CMakeLists.txt @@ -634,6 +634,7 @@ add_library( ${BINARY_NAME} "../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" "../../../../../modules/juce_core/streams/juce_URLInputSource.h" "../../../../../modules/juce_core/system/juce_CompilerSupport.h" + "../../../../../modules/juce_core/system/juce_CompilerWarnings.h" "../../../../../modules/juce_core/system/juce_PlatformDefs.h" "../../../../../modules/juce_core/system/juce_StandardHeader.h" "../../../../../modules/juce_core/system/juce_SystemStats.cpp" @@ -1923,6 +1924,7 @@ set_source_files_properties("../../../../../modules/juce_core/streams/juce_Subre set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerSupport.h" PROPERTIES HEADER_FILE_ONLY TRUE) +set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerWarnings.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_PlatformDefs.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_StandardHeader.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_SystemStats.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) diff --git a/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj b/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj index bcf4bd8e01..7d70bf0e07 100644 --- a/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj +++ b/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj @@ -2191,6 +2191,7 @@ + diff --git a/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj.filters b/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj.filters index fe90a05c6d..e428d32762 100644 --- a/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj.filters +++ b/extras/AudioPerformanceTest/Builds/VisualStudio2019/AudioPerformanceTest_App.vcxproj.filters @@ -3252,6 +3252,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/AudioPluginHost/Builds/Android/app/CMakeLists.txt b/extras/AudioPluginHost/Builds/Android/app/CMakeLists.txt index 71fab100c6..bcb48ae49c 100644 --- a/extras/AudioPluginHost/Builds/Android/app/CMakeLists.txt +++ b/extras/AudioPluginHost/Builds/Android/app/CMakeLists.txt @@ -651,6 +651,7 @@ add_library( ${BINARY_NAME} "../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" "../../../../../modules/juce_core/streams/juce_URLInputSource.h" "../../../../../modules/juce_core/system/juce_CompilerSupport.h" + "../../../../../modules/juce_core/system/juce_CompilerWarnings.h" "../../../../../modules/juce_core/system/juce_PlatformDefs.h" "../../../../../modules/juce_core/system/juce_StandardHeader.h" "../../../../../modules/juce_core/system/juce_SystemStats.cpp" @@ -2013,6 +2014,7 @@ set_source_files_properties("../../../../../modules/juce_core/streams/juce_Subre set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerSupport.h" PROPERTIES HEADER_FILE_ONLY TRUE) +set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerWarnings.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_PlatformDefs.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_StandardHeader.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_SystemStats.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) diff --git a/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj b/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj index 56be4fedd7..1099144da1 100644 --- a/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj +++ b/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj @@ -2267,6 +2267,7 @@ + diff --git a/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj.filters b/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj.filters index 6ee9688c2c..1e4b8752e0 100644 --- a/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj.filters +++ b/extras/AudioPluginHost/Builds/VisualStudio2015/AudioPluginHost_App.vcxproj.filters @@ -3405,6 +3405,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj b/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj index 17a156476d..db90221a5e 100644 --- a/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj +++ b/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj @@ -2267,6 +2267,7 @@ + diff --git a/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj.filters b/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj.filters index dfb6a85a22..c787b9c371 100644 --- a/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj.filters +++ b/extras/AudioPluginHost/Builds/VisualStudio2017/AudioPluginHost_App.vcxproj.filters @@ -3405,6 +3405,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj b/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj index dc297038f4..b9f3008a2a 100644 --- a/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj +++ b/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj @@ -2267,6 +2267,7 @@ + diff --git a/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj.filters b/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj.filters index 0ee21ed5f4..a9b9cd5ba0 100644 --- a/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj.filters +++ b/extras/AudioPluginHost/Builds/VisualStudio2019/AudioPluginHost_App.vcxproj.filters @@ -3405,6 +3405,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj b/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj index 2f9f287210..6369613695 100644 --- a/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj +++ b/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj @@ -524,6 +524,7 @@ + diff --git a/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj.filters b/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj.filters index 39e7627c8c..1cb4265e19 100644 --- a/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj.filters +++ b/extras/BinaryBuilder/Builds/VisualStudio2019/BinaryBuilder_ConsoleApp.vcxproj.filters @@ -642,6 +642,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/NetworkGraphicsDemo/Builds/Android/app/CMakeLists.txt b/extras/NetworkGraphicsDemo/Builds/Android/app/CMakeLists.txt index 7b7a0535aa..d6ee01eae3 100644 --- a/extras/NetworkGraphicsDemo/Builds/Android/app/CMakeLists.txt +++ b/extras/NetworkGraphicsDemo/Builds/Android/app/CMakeLists.txt @@ -638,6 +638,7 @@ add_library( ${BINARY_NAME} "../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" "../../../../../modules/juce_core/streams/juce_URLInputSource.h" "../../../../../modules/juce_core/system/juce_CompilerSupport.h" + "../../../../../modules/juce_core/system/juce_CompilerWarnings.h" "../../../../../modules/juce_core/system/juce_PlatformDefs.h" "../../../../../modules/juce_core/system/juce_StandardHeader.h" "../../../../../modules/juce_core/system/juce_SystemStats.cpp" @@ -2002,6 +2003,7 @@ set_source_files_properties("../../../../../modules/juce_core/streams/juce_Subre set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/streams/juce_URLInputSource.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerSupport.h" PROPERTIES HEADER_FILE_ONLY TRUE) +set_source_files_properties("../../../../../modules/juce_core/system/juce_CompilerWarnings.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_PlatformDefs.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_StandardHeader.h" PROPERTIES HEADER_FILE_ONLY TRUE) set_source_files_properties("../../../../../modules/juce_core/system/juce_SystemStats.cpp" PROPERTIES HEADER_FILE_ONLY TRUE) diff --git a/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj b/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj index 5188dbe076..082592e57b 100644 --- a/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj +++ b/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj @@ -2276,6 +2276,7 @@ + diff --git a/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj.filters b/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj.filters index 86db98d8bc..c1edaf5f75 100644 --- a/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj.filters +++ b/extras/NetworkGraphicsDemo/Builds/VisualStudio2019/NetworkGraphicsDemo_App.vcxproj.filters @@ -3387,6 +3387,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj b/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj index 604e07683a..25f923517a 100644 --- a/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj +++ b/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj @@ -1771,6 +1771,7 @@ + diff --git a/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj.filters b/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj.filters index 04bd2bdb74..ad63e271d1 100644 --- a/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj.filters +++ b/extras/Projucer/Builds/VisualStudio2015/Projucer_App.vcxproj.filters @@ -2724,6 +2724,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj b/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj index cfb85d01ea..4adbfe2f3a 100644 --- a/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj +++ b/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj @@ -1771,6 +1771,7 @@ + diff --git a/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj.filters b/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj.filters index 568d0c2fbf..e8840a14e9 100644 --- a/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj.filters +++ b/extras/Projucer/Builds/VisualStudio2017/Projucer_App.vcxproj.filters @@ -2724,6 +2724,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj b/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj index fa04d83271..fb1fe9dcd6 100644 --- a/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj +++ b/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj @@ -1771,6 +1771,7 @@ + diff --git a/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj.filters b/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj.filters index fcca2f08e9..bea1bfdaff 100644 --- a/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj.filters +++ b/extras/Projucer/Builds/VisualStudio2019/Projucer_App.vcxproj.filters @@ -2724,6 +2724,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj b/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj index 9afc8b318c..f2a742b398 100644 --- a/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj +++ b/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj @@ -2472,6 +2472,7 @@ + diff --git a/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj.filters b/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj.filters index bcb49dd45f..8aefc52534 100644 --- a/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj.filters +++ b/extras/UnitTestRunner/Builds/VisualStudio2017/UnitTestRunner_ConsoleApp.vcxproj.filters @@ -3723,6 +3723,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj b/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj index e5e3eda786..2fb33d8c53 100644 --- a/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj +++ b/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj @@ -2472,6 +2472,7 @@ + diff --git a/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj.filters b/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj.filters index 76733f7843..419f6719fb 100644 --- a/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj.filters +++ b/extras/UnitTestRunner/Builds/VisualStudio2019/UnitTestRunner_ConsoleApp.vcxproj.filters @@ -3723,6 +3723,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj b/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj index 32aab30c54..e8e27a98da 100644 --- a/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj +++ b/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj @@ -2252,6 +2252,7 @@ + diff --git a/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj.filters b/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj.filters index 525d6fbb17..de1ce40c47 100644 --- a/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj.filters +++ b/extras/WindowsDLL/Builds/VisualStudio2019/WindowsDLL_StaticLibrary.vcxproj.filters @@ -3354,6 +3354,9 @@ JUCE Modules\juce_core\system + + JUCE Modules\juce_core\system + JUCE Modules\juce_core\system diff --git a/modules/juce_audio_devices/juce_audio_devices.cpp b/modules/juce_audio_devices/juce_audio_devices.cpp index 6c79d2c7f0..e0066c2f30 100644 --- a/modules/juce_audio_devices/juce_audio_devices.cpp +++ b/modules/juce_audio_devices/juce_audio_devices.cpp @@ -84,15 +84,13 @@ #include #include - #pragma warning (push) - #pragma warning (disable: 4265) + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4265) #include - #pragma warning (pop) + JUCE_END_IGNORE_WARNINGS_MSVC - #pragma warning (push) - #pragma warning (disable: 4467) + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4467) #include - #pragma warning (pop) + JUCE_END_IGNORE_WARNINGS_MSVC #endif #if JUCE_ASIO @@ -169,10 +167,9 @@ #error "Oboe cannot be enabled at the same time as openSL! Please disable JUCE_USE_ANDROID_OPENSLES" #endif - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wunused-parameter" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wunused-parameter") #include - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #endif #endif diff --git a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp index 86b064047f..856ce075da 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp @@ -29,10 +29,7 @@ namespace juce #define JUCE_COREAUDIOLOG(a) #endif -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wnonnull" // avoid some spurious 10.11 SDK warnings -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnonnull") //============================================================================== struct SystemVol @@ -124,9 +121,7 @@ private: } }; -#ifdef __clang__ - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #define JUCE_SYSTEMAUDIOVOL_IMPLEMENTED 1 float JUCE_CALLTYPE SystemAudioVolume::getGain() { return SystemVol (kAudioHardwareServiceDeviceProperty_VirtualMasterVolume).getGain(); } diff --git a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp index 2fda4f5dfc..7d6da2d91f 100644 --- a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.cpp @@ -90,9 +90,8 @@ namespace FlacNamespace #define FLAC__NO_DLL 1 - #if JUCE_MSVC - #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4312 4505 4365 4005 4334 181 111) - #else + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4312 4505 4365 4005 4334 181 111) + #if ! JUCE_MSVC #define HAVE_LROUND 1 #endif @@ -104,32 +103,15 @@ namespace FlacNamespace #define SIZE_MAX 0xffffffff #endif - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wshadow" - #pragma clang diagnostic ignored "-Wdeprecated-register" - #pragma clang diagnostic ignored "-Wswitch-enum" - #if __has_warning ("-Wimplicit-fallthrough") - #pragma clang diagnostic ignored "-Wimplicit-fallthrough" - #endif - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #endif - - #if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wswitch-enum" - #pragma GCC diagnostic ignored "-Wswitch-default" - #pragma GCC diagnostic ignored "-Wredundant-decls" - #if __GNUC__ >= 7 - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" - #endif - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion", + "-Wshadow", + "-Wdeprecated-register", + "-Wswitch-enum", + "-Wswitch-default", + "-Wimplicit-fallthrough", + "-Wzero-as-null-pointer-constant", + "-Wsign-conversion", + "-Wredundant-decls") #if JUCE_INTEL #if JUCE_32BIT @@ -167,13 +149,8 @@ namespace FlacNamespace #include #endif - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif - - #if JUCE_GCC - #pragma GCC diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + JUCE_END_IGNORE_WARNINGS_MSVC } #undef max diff --git a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp index 9778ecca1d..8ad8fd92ad 100644 --- a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.cpp @@ -28,30 +28,17 @@ namespace juce namespace OggVorbisNamespace { #if JUCE_INCLUDE_OGGVORBIS_CODE || ! defined (JUCE_INCLUDE_OGGVORBIS_CODE) - #if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706 4995 4365 4456 4457 4459) - #elif JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wshadow" - #pragma clang diagnostic ignored "-Wfloat-conversion" - #pragma clang diagnostic ignored "-Wdeprecated-register" - #pragma clang diagnostic ignored "-Wswitch-enum" - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #elif JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wshadow" - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wfloat-conversion" - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #pragma GCC diagnostic ignored "-Wswitch-enum" - #pragma GCC diagnostic ignored "-Wswitch-default" - #pragma GCC diagnostic ignored "-Wredundant-decls" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4267 4127 4244 4996 4100 4701 4702 4013 4133 4206 4305 4189 4706 4995 4365 4456 4457 4459) + + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion", + "-Wshadow", + "-Wfloat-conversion", + "-Wdeprecated-register", + "-Wswitch-enum", + "-Wzero-as-null-pointer-constant", + "-Wsign-conversion", + "-Wswitch-default", + "-Wredundant-decls") #include "oggvorbis/vorbisenc.h" #include "oggvorbis/codec.h" @@ -81,13 +68,8 @@ namespace OggVorbisNamespace #include "oggvorbis/libvorbis-1.3.2/lib/vorbisfile.c" #include "oggvorbis/libvorbis-1.3.2/lib/window.c" - #if JUCE_MSVC - #pragma warning (pop) - #elif JUCE_CLANG - #pragma clang diagnostic pop - #elif JUCE_GCC - #pragma GCC diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_MSVC + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #else #include #include diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 60615167ef..e93bcdd291 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -28,27 +28,14 @@ #include "../../juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp" -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wnon-virtual-dtor" - #pragma clang diagnostic ignored "-Wsign-conversion" - #pragma clang diagnostic ignored "-Wextra-semi" - #pragma clang diagnostic ignored "-Wshift-sign-overflow" - #if __has_warning("-Wpragma-pack") - #pragma clang diagnostic ignored "-Wpragma-pack" - #endif - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #if __has_warning("-Winconsistent-missing-destructor-override") - #pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" - #endif -#endif - -#ifdef _MSC_VER - #pragma warning (push) - #pragma warning (disable : 4127 4512) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4127 4512) +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", + "-Wsign-conversion", + "-Wextra-semi", + "-Wshift-sign-overflow", + "-Wpragma-pack", + "-Wzero-as-null-pointer-constant", + "-Winconsistent-missing-destructor-override") #include @@ -82,13 +69,8 @@ static_assert (AAX_SDK_CURRENT_REVISION >= AAX_SDK_2p3p0_REVISION, "JUCE require #endif #endif -#ifdef _MSC_VER - #pragma warning (pop) -#endif - -#ifdef __clang__ - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #if JUCE_WINDOWS #ifndef JucePlugin_AAXLibs_path diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 282f6aed6e..91133ee978 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -15,7 +15,7 @@ ============================================================================== */ -#include "../../juce_core/system/juce_TargetPlatform.h" +#include "../../juce_core/system/juce_CompilerWarnings.h" #include "../utility/juce_CheckSettingMacros.h" #if JucePlugin_Build_AU @@ -25,25 +25,18 @@ #define JUCE_SUPPORT_CARBON 0 #endif -#ifdef JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wshorten-64-to-32" - #pragma clang diagnostic ignored "-Wunused-parameter" - #pragma clang diagnostic ignored "-Wdeprecated-declarations" - #pragma clang diagnostic ignored "-Wsign-conversion" - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Woverloaded-virtual" - #pragma clang diagnostic ignored "-Wextra-semi" - #pragma clang diagnostic ignored "-Wcast-align" - #pragma clang diagnostic ignored "-Wshadow" - #pragma clang diagnostic ignored "-Wswitch-enum" - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #if __has_warning("-Wnullable-to-nonnull-conversion") - #pragma clang diagnostic ignored "-Wnullable-to-nonnull-conversion" - #endif -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wshorten-64-to-32", + "-Wunused-parameter", + "-Wdeprecated-declarations", + "-Wsign-conversion", + "-Wconversion", + "-Woverloaded-virtual", + "-Wextra-semi", + "-Wcast-align", + "-Wshadow", + "-Wswitch-enum", + "-Wzero-as-null-pointer-constant", + "-Wnullable-to-nonnull-conversion") #include "../utility/juce_IncludeSystemHeaders.h" @@ -70,9 +63,7 @@ #include "CoreAudioUtilityClasses/AUCarbonViewBase.h" #endif -#ifdef JUCE_CLANG - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #define JUCE_MAC_WINDOW_VISIBITY_BODGE 1 #define JUCE_CORE_INCLUDE_OBJC_HELPERS 1 @@ -2498,19 +2489,11 @@ JUCE_FACTORY_ENTRY (JuceAU, JucePlugin_AUExportPrefix) #endif #if ! JUCE_DISABLE_AU_FACTORY_ENTRY - #ifdef JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wcast-align" - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wcast-align", "-Wzero-as-null-pointer-constant") #include "CoreAudioUtilityClasses/AUPlugInDispatch.cpp" - #ifdef JUCE_CLANG - #pragma clang diagnostic push - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #endif #endif diff --git a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm index b8872446e0..4810a0f63c 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm @@ -69,8 +69,7 @@ #define JUCE_AUDIOUNIT_OBJC_NAME(x) JUCE_JOIN_MACRO (x, AUv3) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wnullability-completeness" +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnullability-completeness") using namespace juce; @@ -108,13 +107,12 @@ public: JuceAudioUnitv3Base (const AudioComponentDescription& descr, AudioComponentInstantiationOptions options, NSError** error) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wobjc-method-access" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wobjc-method-access") : au ([audioUnitObjCClass.createInstance() initWithComponentDescription: descr options: options error: error juceClass: this]) - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE {} JuceAudioUnitv3Base (AUAudioUnit* audioUnit) : au (audioUnit) @@ -213,13 +211,12 @@ private: { addIvar ("cppObject"); - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (initWithComponentDescription:options:error:juceClass:), initWithComponentDescriptionAndJuceClass, "@@:", @encode (AudioComponentDescription), @encode (AudioComponentInstantiationOptions), "^@@"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addMethod (@selector (initWithComponentDescription:options:error:), initWithComponentDescription, "@@:", @@ -1945,5 +1942,5 @@ Image JUCE_CALLTYPE juce_getIAAHostIcon (int) { return {}; } #endif #endif -#pragma clang diagnostic pop +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #endif diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp index 5480d21096..9b5d690ea7 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode1.cpp @@ -45,15 +45,12 @@ #undef UNICODE #endif -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wnon-virtual-dtor" - #pragma clang diagnostic ignored "-Wcomment" - #pragma clang diagnostic ignored "-Wreorder" - #pragma clang diagnostic ignored "-Wextra-tokens" - #pragma clang diagnostic ignored "-Wunused-variable" - #pragma clang diagnostic ignored "-Wdeprecated" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", + "-Wcomment", + "-Wreorder", + "-Wextra-tokens", + "-Wunused-variable", + "-Wdeprecated") #include #include @@ -64,8 +61,6 @@ #include #include -#ifdef __clang__ - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #endif diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp index 6c5850cedb..4f234502cd 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode2.cpp @@ -25,14 +25,11 @@ #include "juce_RTAS_DigiCode_Header.h" -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wcomment" - #pragma clang diagnostic ignored "-Wextra-tokens" - #pragma clang diagnostic ignored "-Wnon-virtual-dtor" - #pragma clang diagnostic ignored "-Wreorder" - #pragma clang diagnostic ignored "-Wdeprecated" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wcomment", + "-Wextra-tokens", + "-Wnon-virtual-dtor", + "-Wreorder", + "-Wdeprecated") /* This file is used to include and build the required digidesign CPP files without your project @@ -52,8 +49,6 @@ #include #include -#ifdef __clang__ - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #endif diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp index f2f00512ea..5149712178 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_DigiCode3.cpp @@ -26,12 +26,7 @@ #include "../utility/juce_IncludeSystemHeaders.h" #include "juce_RTAS_DigiCode_Header.h" - #ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wnon-virtual-dtor" - #pragma clang diagnostic ignored "-Wextra-tokens" - #pragma clang diagnostic ignored "-Wreorder" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", "-Wextra-tokens", "-Wreorder") /* This file is used to include and build the required digidesign CPP files without your project @@ -60,9 +55,7 @@ #include #endif - #ifdef __clang__ - #pragma clang diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #else diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp index f45cd9e302..501995b082 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp @@ -37,12 +37,9 @@ #include #endif -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Widiomatic-parentheses" - #pragma clang diagnostic ignored "-Wnon-virtual-dtor" - #pragma clang diagnostic ignored "-Wcomment" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Widiomatic-parentheses", + "-Wnon-virtual-dtor", + "-Wcomment") /* Note about include paths ------------------------ @@ -91,15 +88,10 @@ #include #include -#ifdef __clang__ - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE //============================================================================== -#ifdef _MSC_VER - #pragma pack (push, 8) - #pragma warning (disable: 4263 4264 4250) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4263 4264 4250) #include "../utility/juce_IncludeModuleHeaders.h" @@ -1053,4 +1045,6 @@ CProcessGroupInterface* CProcessGroup::CreateProcessGroup() return new JucePlugInGroup(); } +JUCE_END_IGNORE_WARNINGS_MSVC + #endif diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index 50aeef0192..2358293a84 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -16,14 +16,13 @@ ============================================================================== */ +#include "../../juce_core/system/juce_CompilerWarnings.h" #include "../../juce_core/system/juce_TargetPlatform.h" #include "../utility/juce_CheckSettingMacros.h" #if JucePlugin_Build_VST -#ifdef _MSC_VER - #pragma warning (disable : 4996 4100) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996 4100) #include "../utility/juce_IncludeSystemHeaders.h" #include @@ -59,29 +58,14 @@ #define __cdecl #endif -#if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wshadow" - #pragma clang diagnostic ignored "-Wdeprecated-register" - #pragma clang diagnostic ignored "-Wunused-parameter" - #pragma clang diagnostic ignored "-Wdeprecated-writable-strings" - #pragma clang diagnostic ignored "-Wnon-virtual-dtor" - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif -#endif - -#if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wshadow" - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" -#endif - -#ifdef _MSC_VER - #pragma warning (push) - #pragma warning (disable : 4458) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion", + "-Wshadow", + "-Wdeprecated-register", + "-Wunused-parameter", + "-Wdeprecated-writable-strings", + "-Wnon-virtual-dtor", + "-Wzero-as-null-pointer-constant") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4458) #define VST_FORCE_DEPRECATED 0 @@ -99,17 +83,8 @@ namespace Vst2 using namespace juce; -#ifdef _MSC_VER - #pragma warning (pop) -#endif - -#if JUCE_CLANG - #pragma clang diagnostic pop -#endif - -#if JUCE_GCC - #pragma GCC diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE //============================================================================== #ifdef _MSC_VER @@ -2256,4 +2231,6 @@ namespace } #endif +JUCE_END_IGNORE_WARNINGS_MSVC + #endif diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 772e27a523..9e8012039f 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -16,6 +16,7 @@ ============================================================================== */ +#include "../../juce_core/system/juce_CompilerWarnings.h" #include "../../juce_core/system/juce_TargetPlatform.h" //============================================================================== @@ -54,17 +55,6 @@ namespace Vst2 #endif #endif -#if JUCE_VST3_CAN_REPLACE_VST2 - #if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4514 4996) - #endif - - #if JUCE_MSVC - #pragma warning (pop) - #endif -#endif - namespace juce { @@ -351,16 +341,11 @@ public: static const FUID iid; //============================================================================== - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Winconsistent-missing-override" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Winconsistent-missing-override") REFCOUNT_METHODS (ComponentBase) - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE tresult PLUGIN_API queryInterface (const TUID targetIID, void** obj) override { @@ -2804,13 +2789,8 @@ private: const char* JuceVST3Component::kJucePrivateDataIdentifier = "JUCEPrivateData"; //============================================================================== -#if JUCE_MSVC - #pragma warning (push, 0) - #pragma warning (disable: 4310) -#elif JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wall" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4310) +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wall") DECLARE_CLASS_IID (JuceAudioProcessor, 0x0101ABAB, 0xABCDEF01, JucePlugin_ManufacturerCode, JucePlugin_PluginCode) DEF_CLASS_IID (JuceAudioProcessor) @@ -2833,11 +2813,8 @@ DEF_CLASS_IID (JuceAudioProcessor) DEF_CLASS_IID (JuceVST3Component) #endif -#if JUCE_MSVC - #pragma warning (pop) -#elif JUCE_CLANG - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE //============================================================================== bool initModule() diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm index c6c6396073..f16193d1d7 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_2.mm @@ -18,30 +18,23 @@ #if JucePlugin_Build_AU -#ifdef __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wparentheses" - #pragma clang diagnostic ignored "-Wextra-tokens" - #pragma clang diagnostic ignored "-Wcomment" - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wunused-parameter" - #pragma clang diagnostic ignored "-Wunused" - #pragma clang diagnostic ignored "-Wextra-semi" - #pragma clang diagnostic ignored "-Wformat-pedantic" - #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" - #pragma clang diagnostic ignored "-Wshadow-all" - #pragma clang diagnostic ignored "-Wcast-align" - #pragma clang diagnostic ignored "-Wswitch-enum" - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #if __has_warning("-Wnullable-to-nonnull-conversion") - #pragma clang diagnostic ignored "-Wnullable-to-nonnull-conversion" - #endif - #if __has_warning("-Wignored-qualifiers") - #pragma clang diagnostic ignored "-Wignored-qualifiers" - #endif -#endif +#include "../juce_core/system/juce_CompilerWarnings.h" + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wparentheses", + "-Wextra-tokens", + "-Wcomment", + "-Wconversion", + "-Wunused-parameter", + "-Wunused", + "-Wextra-semi", + "-Wformat-pedantic", + "-Wgnu-zero-variadic-macro-arguments", + "-Wshadow-all", + "-Wcast-align", + "-Wswitch-enum", + "-Wzero-as-null-pointer-constant", + "-Wnullable-to-nonnull-conversion", + "-Wignored-qualifiers") // From MacOS 10.13 and iOS 11 Apple has (sensibly!) stopped defining a whole // set of functions with rather generic names. However, we still need a couple @@ -76,8 +69,6 @@ #undef verify #undef verify_noerr -#ifdef __clang__ - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #endif diff --git a/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp b/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp index 219fb81443..ea1d498f1c 100644 --- a/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp +++ b/modules/juce_audio_processors/format_types/juce_LegacyAudioParameter.cpp @@ -19,16 +19,8 @@ namespace juce { -#if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#elif JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wdeprecated-declarations" -#elif JUCE_MSVC - #pragma warning (push, 0) - #pragma warning (disable: 4996) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) class LegacyAudioParameter : public AudioProcessorParameter { @@ -168,12 +160,7 @@ private: bool legacyParamIDs = false, usingManagedParameters = false; }; -#if JUCE_GCC - #pragma GCC diagnostic pop -#elif JUCE_CLANG - #pragma clang diagnostic pop -#elif JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC } // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_VST3Headers.h b/modules/juce_audio_processors/format_types/juce_VST3Headers.h index d15f656fc8..0d4b1d1ae4 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Headers.h @@ -17,54 +17,33 @@ */ // Wow, those Steinberg guys really don't worry too much about compiler warnings. -#if _MSC_VER - #pragma warning (disable: 4505) - #pragma warning (push, 0) - #pragma warning (disable: 4702) -#elif __clang__ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wnon-virtual-dtor" - #pragma clang diagnostic ignored "-Wreorder" - #pragma clang diagnostic ignored "-Wunsequenced" - #pragma clang diagnostic ignored "-Wint-to-pointer-cast" - #pragma clang diagnostic ignored "-Wunused-parameter" - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Woverloaded-virtual" - #pragma clang diagnostic ignored "-Wshadow" - #pragma clang diagnostic ignored "-Wdeprecated-register" - #pragma clang diagnostic ignored "-Wunused-function" - #pragma clang diagnostic ignored "-Wsign-conversion" - #pragma clang diagnostic ignored "-Wsign-compare" - #pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor" - #pragma clang diagnostic ignored "-Wdeprecated-declarations" - #pragma clang diagnostic ignored "-Wextra-semi" - #pragma clang diagnostic ignored "-Wmissing-braces" - #pragma clang diagnostic ignored "-Wswitch-default" - #if __has_warning("-Wshadow-field") - #pragma clang diagnostic ignored "-Wshadow-field" - #endif - #if __has_warning("-Wpragma-pack") - #pragma clang diagnostic ignored "-Wpragma-pack" - #endif - #if __has_warning("-Wcomma") - #pragma clang diagnostic ignored "-Wcomma" - #endif - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #if __has_warning("-Winconsistent-missing-destructor-override") - #pragma clang diagnostic ignored "-Winconsistent-missing-destructor-override" - #endif - #if __has_warning("-Wcast-align") - #pragma clang diagnostic ignored "-Wcast-align" - #endif - #if __has_warning("-Wignored-qualifiers") - #pragma clang diagnostic ignored "-Wignored-qualifiers" - #endif - #if __has_warning("-Wmissing-field-initializers") - #pragma clang diagnostic ignored "-Wmissing-field-initializers" - #endif -#endif +JUCE_BEGIN_IGNORE_WARNINGS_LEVEL_MSVC (0, 4505 4702) + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wnon-virtual-dtor", + "-Wreorder", + "-Wunsequenced", + "-Wint-to-pointer-cast", + "-Wunused-parameter", + "-Wconversion", + "-Woverloaded-virtual", + "-Wshadow", + "-Wdeprecated-register", + "-Wunused-function", + "-Wsign-conversion", + "-Wsign-compare", + "-Wdelete-non-virtual-dtor", + "-Wdeprecated-declarations", + "-Wextra-semi", + "-Wmissing-braces", + "-Wswitch-default", + "-Wshadow-field", + "-Wpragma-pack", + "-Wcomma", + "-Wzero-as-null-pointer-constant", + "-Winconsistent-missing-destructor-override", + "-Wcast-align", + "-Wignored-qualifiers", + "-Wmissing-field-initializers") #undef DEVELOPMENT #define DEVELOPMENT 0 // This avoids a Clang warning in Steinberg code about unused values @@ -162,11 +141,8 @@ namespace Steinberg } #endif //JUCE_VST3HEADERS_INCLUDE_HEADERS_ONLY -#if _MSC_VER - #pragma warning (pop) -#elif __clang__ - #pragma clang diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #if JUCE_WINDOWS #include diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index 67405d9522..39fe46519c 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -1369,10 +1369,7 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VST3PluginWindow) }; -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4996) // warning about overriding deprecated methods -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) // warning about overriding deprecated methods //============================================================================== struct VST3ComponentHolder @@ -2870,9 +2867,7 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VST3PluginInstance) }; -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== AudioPluginInstance* VST3ComponentHolder::createPluginInstance() diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 5bd142dbf0..d268aeb049 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -21,24 +21,13 @@ //============================================================================== #undef PRAGMA_ALIGN_SUPPORTED -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4996) -#elif ! JUCE_MINGW - #define __cdecl -#endif -#if JUCE_CLANG - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif +#if ! JUCE_MINGW && ! JUCE_MSVC + #define __cdecl #endif -#if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) #define VST_FORCE_DEPRECATED 0 #define JUCE_VSTINTERFACE_H_INCLUDED 1 @@ -56,20 +45,10 @@ namespace Vst2 #include "juce_VSTCommon.h" -#if JUCE_MSVC - #pragma warning (pop) - #pragma warning (disable: 4355) // ("this" used in initialiser list warning) -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC -#if JUCE_CLANG - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic pop - #endif -#endif - -#if JUCE_GCC - #pragma GCC diagnostic pop -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4355) #include "juce_VSTMidiEventList.h" @@ -841,10 +820,7 @@ private: static const int defaultVSTSampleRateValue = 44100; static const int defaultVSTBlockSizeValue = 512; -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4996) // warning about overriding deprecated methods -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) //============================================================================== struct VSTPluginInstance : public AudioPluginInstance, @@ -2100,16 +2076,11 @@ private: pointer_sized_int getVSTTime() noexcept { - #if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4311) - #endif + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4311) return (pointer_sized_int) &vstHostTime; - #if JUCE_MSVC - #pragma warning (pop) - #endif + JUCE_END_IGNORE_WARNINGS_MSVC } void handleIdle() @@ -3129,8 +3100,7 @@ private: return; } - #pragma warning (push) - #pragma warning (disable: 4244) + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4244) if (! pluginWantsKeys) { @@ -3138,7 +3108,7 @@ private: SetWindowLongPtr (pluginHWND, GWLP_WNDPROC, (LONG_PTR) vstHookWndProc); } - #pragma warning (pop) + JUCE_END_IGNORE_WARNINGS_MSVC RECT r; GetWindowRect (pluginHWND, &r); @@ -3237,11 +3207,10 @@ private: stopTimer(); #if JUCE_WINDOWS - #pragma warning (push) - #pragma warning (disable: 4244) + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4244) if (originalWndProc != 0 && pluginHWND != 0 && IsWindow (pluginHWND)) SetWindowLongPtr (pluginHWND, GWLP_WNDPROC, (LONG_PTR) originalWndProc); - #pragma warning (pop) + JUCE_END_IGNORE_WARNINGS_MSVC originalWndProc = 0; pluginHWND = 0; @@ -3453,9 +3422,7 @@ private: }; #endif -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== AudioProcessorEditor* VSTPluginInstance::createEditor() @@ -3777,4 +3744,6 @@ void VSTPluginFormat::aboutToScanVSTShellPlugin (const PluginDescription&) {} } // namespace juce +JUCE_END_IGNORE_WARNINGS_MSVC + #endif diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index d50f099540..a18a99a310 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -121,12 +121,7 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone } // namespace juce -#if JUCE_CLANG - #pragma clang diagnostic ignored "-Wdeprecated-declarations" - #if __has_warning("-Wcast-align") - #pragma clang diagnostic ignored "-Wcast-align" - #endif -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations", "-Wcast-align") #include "format/juce_AudioPluginFormat.cpp" #include "format/juce_AudioPluginFormatManager.cpp" diff --git a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h index e82bd2aebb..7f9f7bb5bc 100644 --- a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h +++ b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h @@ -19,13 +19,9 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push, 0) - - // MSVC does not like it if you override a deprecated method even if you - // keep the deprecation attribute. Other compilers are more forgiving. - #pragma warning (disable: 4996) -#endif +// MSVC does not like it if you override a deprecated method even if you +// keep the deprecation attribute. Other compilers are more forgiving. +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) //============================================================================== /** @@ -118,8 +114,6 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginInstance) }; -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC } // namespace juce diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp index dec8bc5786..d8efe07075 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp @@ -1176,16 +1176,8 @@ const char* AudioProcessor::getWrapperTypeDescription (AudioProcessor::WrapperTy } //============================================================================== -#if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#elif JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wdeprecated-declarations" -#elif JUCE_MSVC - #pragma warning (push, 0) - #pragma warning (disable: 4996) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) void AudioProcessor::setParameterNotifyingHost (int parameterIndex, float newValue) { @@ -1420,13 +1412,8 @@ AudioProcessorParameter* AudioProcessor::getParamChecked (int index) const return p; } -#if JUCE_GCC - #pragma GCC diagnostic pop -#elif JUCE_CLANG - #pragma clang diagnostic pop -#elif JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== void AudioProcessorListener::audioProcessorParameterChangeGestureBegin (AudioProcessor*, int) {} diff --git a/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm b/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm index 5e5fef3d40..1be4c4ffb5 100644 --- a/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm +++ b/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm @@ -27,12 +27,11 @@ struct AudioTrackProducerClass : public ObjCClass { addIvar ("source"); - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (initWithAudioSourceHolder:), initWithAudioSourceHolder, "@@:^v"); addMethod (@selector (verifyDataForTrack:intoBuffer:length:atAddress:blockSize:ioFlags:), produceDataForTrack, "I@:@^cIQI^I"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addMethod (@selector (cleanupTrackAfterBurn:), cleanupTrackAfterBurn, "v@:@"); addMethod (@selector (cleanupTrackAfterVerification:), cleanupTrackAfterVerification, "c@:@"); @@ -181,11 +180,10 @@ struct OpenDiskDevice static AudioTrackProducerClass cls; - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") NSObject* producer = [cls.createInstance() performSelector: @selector (initWithAudioSourceHolder:) withObject: (id) new AudioTrackProducerClass::AudioSourceHolder (source, numFrames)]; - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE DRTrack* track = [[DRTrack alloc] initWithProducer: producer]; { diff --git a/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm b/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm index 8443b8901b..2cfeb8f549 100644 --- a/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm +++ b/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm @@ -36,12 +36,11 @@ public: addIvar ("callbacks"); addIvar ("controller"); - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (initWithCallbacks:), initWithCallbacks, "@@:^v"); addMethod (@selector (show:), show, "v@:^v"); addMethod (@selector (receivedWindowWillClose:), receivedWindowWillClose, "v@:^v"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addMethod (@selector (dealloc), dealloc, "v@:"); @@ -61,13 +60,12 @@ private: object_setInstanceVariable (self, "callbacks", cbs); object_setInstanceVariable (self, "controller", [CABTLEMIDIWindowController new]); - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector (receivedWindowWillClose:) name: @"NSWindowWillCloseNotification" object: [getController (self) window]]; - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE return self; } @@ -137,13 +135,12 @@ public: callbacks.reset (new BluetoothMidiPairingWindowClass::Callbacks { std::move (exitCB), std::move (deletionCB) }); - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [window.get() performSelector: @selector (initWithCallbacks:) withObject: (id) callbacks.get()]; [window.get() performSelector: @selector (show:) withObject: (id) bounds]; - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } private: diff --git a/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h b/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h index c4f864b525..6488a535d7 100644 --- a/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h +++ b/modules/juce_blocks_basics/littlefoot/juce_LittleFootCompiler.h @@ -20,10 +20,7 @@ ============================================================================== */ -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4702) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4702) namespace littlefoot { @@ -2454,6 +2451,4 @@ private: } -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC diff --git a/modules/juce_box2d/juce_box2d.cpp b/modules/juce_box2d/juce_box2d.cpp index 4bb09081b9..3fbb525c18 100644 --- a/modules/juce_box2d/juce_box2d.cpp +++ b/modules/juce_box2d/juce_box2d.cpp @@ -27,26 +27,14 @@ #include "juce_box2d.h" -#if defined JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wsign-conversion" - #pragma clang diagnostic ignored "-Wfloat-conversion" - #pragma clang diagnostic ignored "-Wcast-align" - #pragma clang diagnostic ignored "-Wswitch-enum" - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif -#elif defined JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wfloat-conversion" - #pragma GCC diagnostic ignored "-Wunused-but-set-variable" - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #pragma GCC diagnostic ignored "-Wswitch-enum" - #pragma GCC diagnostic ignored "-Wswitch-default" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion", + "-Wsign-conversion", + "-Wfloat-conversion", + "-Wcast-align", + "-Wswitch-enum", + "-Wswitch-default", + "-Wunused-but-set-variable", + "-Wzero-as-null-pointer-constant") #include @@ -105,8 +93,4 @@ using uint32 = juce::uint32; #include "utils/juce_Box2DRenderer.cpp" -#if defined JUCE_CLANG - #pragma clang diagnostic pop -#elif defined JUCE_GCC - #pragma GCC diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE diff --git a/modules/juce_box2d/juce_box2d.h b/modules/juce_box2d/juce_box2d.h index 19ef124cb5..7787c4a3b8 100644 --- a/modules/juce_box2d/juce_box2d.h +++ b/modules/juce_box2d/juce_box2d.h @@ -47,35 +47,17 @@ //============================================================================== #include -#ifdef JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #if __has_warning("-Wshadow-field") - #pragma clang diagnostic ignored "-Wshadow-field" - #endif - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif -#endif - -#ifdef JUCE_GCC - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion", + "-Wshadow-field", + "-Wzero-as-null-pointer-constant", + "-Wsign-conversion") #include #include #include "box2d/Box2D.h" -#ifdef JUCE_CLANG - #pragma clang diagnostic pop -#endif - -#ifdef JUCE_GCC - #pragma GCC diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #ifndef DOXYGEN // for some reason, Doxygen sees this as a re-definition of Box2DRenderer #include "utils/juce_Box2DRenderer.h" diff --git a/modules/juce_core/containers/juce_SortedSet.h b/modules/juce_core/containers/juce_SortedSet.h index 69d7319d46..1489bd6692 100644 --- a/modules/juce_core/containers/juce_SortedSet.h +++ b/modules/juce_core/containers/juce_SortedSet.h @@ -23,10 +23,7 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4512) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4512) //============================================================================== /** @@ -487,8 +484,6 @@ private: Array data; }; -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC } // namespace juce diff --git a/modules/juce_core/javascript/juce_Javascript.cpp b/modules/juce_core/javascript/juce_Javascript.cpp index 4a92686c73..5077092687 100644 --- a/modules/juce_core/javascript/juce_Javascript.cpp +++ b/modules/juce_core/javascript/juce_Javascript.cpp @@ -54,10 +54,7 @@ namespace TokenTypes JUCE_DECLARE_JS_TOKEN (identifier, "$identifier") } -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4702) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4702) //============================================================================== struct JavascriptEngine::RootObject : public DynamicObject @@ -1913,8 +1910,6 @@ const NamedValueSet& JavascriptEngine::getRootObjectProperties() const noexcept return root->getProperties(); } -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC } // namespace juce diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp index a6a2ef7665..2799122708 100644 --- a/modules/juce_core/juce_core.cpp +++ b/modules/juce_core/juce_core.cpp @@ -53,10 +53,9 @@ #include #include #else - #pragma warning (push) - #pragma warning (disable: 4091) + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4091) #include - #pragma warning (pop) + JUCE_END_IGNORE_WARNINGS_MSVC #if ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES #pragma comment (lib, "DbgHelp.lib") diff --git a/modules/juce_core/juce_core.h b/modules/juce_core/juce_core.h index 4bfc1cc21c..8108f1b28a 100644 --- a/modules/juce_core/juce_core.h +++ b/modules/juce_core/juce_core.h @@ -217,19 +217,14 @@ namespace juce #include "memory/juce_Atomic.h" #include "text/juce_CharacterFunctions.h" -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4514 4996) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4514 4996) #include "text/juce_CharPointer_UTF8.h" #include "text/juce_CharPointer_UTF16.h" #include "text/juce_CharPointer_UTF32.h" #include "text/juce_CharPointer_ASCII.h" -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC #include "text/juce_String.h" #include "text/juce_StringRef.h" @@ -375,11 +370,9 @@ namespace juce } #endif -#if JUCE_MSVC - #pragma warning (pop) +JUCE_END_IGNORE_WARNINGS_MSVC - // In DLL builds, need to disable this warnings for other modules - #if defined (JUCE_DLL_BUILD) || defined (JUCE_DLL) - #pragma warning (disable: 4251) - #endif +// In DLL builds, need to disable this warnings for other modules +#if defined (JUCE_DLL_BUILD) || defined (JUCE_DLL) + JUCE_IGNORE_MSVC (4251) #endif diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index deb95d147b..f3fb8e907c 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -676,8 +676,7 @@ std::unique_ptr URL::downloadToFile (const File& targetLocati // so we'll turn off deprecation warnings. This code will be removed at some point // in the future. -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated" +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated") //============================================================================== class URLConnectionState : public Thread @@ -935,7 +934,7 @@ std::unique_ptr URL::downloadToFile (const File& targetLocati return URL::DownloadTask::createFallbackDownloader (*this, targetLocation, extraHeaders, listener, shouldUsePost); } -#pragma clang diagnostic pop +JUCE_END_IGNORE_WARNINGS_GCC_LIKE #endif diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h index fca469285a..1186ca244f 100644 --- a/modules/juce_core/native/juce_osx_ObjCHelpers.h +++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h @@ -323,10 +323,9 @@ struct ObjCLifetimeManagedClass : public ObjCClass { addIvar ("cppObject"); - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (initWithJuceObject:), initWithJuceObject, "@@:@"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addMethod (@selector (dealloc), dealloc, "v@:"); @@ -370,10 +369,9 @@ ObjCLifetimeManagedClass ObjCLifetimeManagedClass::objCLifetimeMan template NSObject* createNSObjectFromJuceClass (Class* obj) { - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wobjc-method-access" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wobjc-method-access") return [ObjCLifetimeManagedClass::objCLifetimeManagedClass.createInstance() initWithJuceObject:obj]; - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } // Get the JUCE class instance that was tied to the life-time of an NSObject with the diff --git a/modules/juce_core/network/juce_Socket.cpp b/modules/juce_core/network/juce_Socket.cpp index e8df43b96e..e7cb39ca50 100644 --- a/modules/juce_core/network/juce_Socket.cpp +++ b/modules/juce_core/network/juce_Socket.cpp @@ -23,10 +23,7 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable : 4127 4389 4018) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4127 4389 4018) #ifndef AI_NUMERICSERV // (missing in older Mac SDKs) #define AI_NUMERICSERV 0x1000 @@ -791,10 +788,7 @@ bool DatagramSocket::setEnablePortReuse (bool enabled) return false; } -#if JUCE_MSVC - #pragma warning (pop) -#endif - +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== //============================================================================== diff --git a/modules/juce_core/system/juce_CompilerWarnings.h b/modules/juce_core/system/juce_CompilerWarnings.h new file mode 100644 index 0000000000..bc398b80d4 --- /dev/null +++ b/modules/juce_core/system/juce_CompilerWarnings.h @@ -0,0 +1,179 @@ +/* + ============================================================================== + + This file is part of the JUCE library. + Copyright (c) 2017 - ROLI Ltd. + + JUCE is an open source library subject to commercial or open-source + licensing. + + The code included in this file is provided under the terms of the ISC license + http://www.isc.org/downloads/software-support-policy/isc-license. Permission + To use, copy, modify, and/or distribute this software for any purpose with or + without fee is hereby granted provided that the above copyright notice and + this permission notice appear in all copies. + + JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER + EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE + DISCLAIMED. + + ============================================================================== +*/ + +#pragma once + +#include "juce_TargetPlatform.h" + +/** Return the Nth argument. By passing a variadic pack followed by N other + parameters, we can select one of those N parameter based on the length of + the parameter pack. +*/ +#define JUCE_NTH_ARG_(_00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, N, ...)\ + N + +#define JUCE_EACH_00_(FN) +#define JUCE_EACH_01_(FN, X) FN(X) +#define JUCE_EACH_02_(FN, X, ...) FN(X) JUCE_EACH_01_(FN, __VA_ARGS__) +#define JUCE_EACH_03_(FN, X, ...) FN(X) JUCE_EACH_02_(FN, __VA_ARGS__) +#define JUCE_EACH_04_(FN, X, ...) FN(X) JUCE_EACH_03_(FN, __VA_ARGS__) +#define JUCE_EACH_05_(FN, X, ...) FN(X) JUCE_EACH_04_(FN, __VA_ARGS__) +#define JUCE_EACH_06_(FN, X, ...) FN(X) JUCE_EACH_05_(FN, __VA_ARGS__) +#define JUCE_EACH_07_(FN, X, ...) FN(X) JUCE_EACH_06_(FN, __VA_ARGS__) +#define JUCE_EACH_08_(FN, X, ...) FN(X) JUCE_EACH_07_(FN, __VA_ARGS__) +#define JUCE_EACH_09_(FN, X, ...) FN(X) JUCE_EACH_08_(FN, __VA_ARGS__) +#define JUCE_EACH_10_(FN, X, ...) FN(X) JUCE_EACH_09_(FN, __VA_ARGS__) +#define JUCE_EACH_11_(FN, X, ...) FN(X) JUCE_EACH_10_(FN, __VA_ARGS__) +#define JUCE_EACH_12_(FN, X, ...) FN(X) JUCE_EACH_11_(FN, __VA_ARGS__) +#define JUCE_EACH_13_(FN, X, ...) FN(X) JUCE_EACH_12_(FN, __VA_ARGS__) +#define JUCE_EACH_14_(FN, X, ...) FN(X) JUCE_EACH_13_(FN, __VA_ARGS__) +#define JUCE_EACH_15_(FN, X, ...) FN(X) JUCE_EACH_14_(FN, __VA_ARGS__) +#define JUCE_EACH_16_(FN, X, ...) FN(X) JUCE_EACH_15_(FN, __VA_ARGS__) +#define JUCE_EACH_17_(FN, X, ...) FN(X) JUCE_EACH_16_(FN, __VA_ARGS__) +#define JUCE_EACH_18_(FN, X, ...) FN(X) JUCE_EACH_17_(FN, __VA_ARGS__) +#define JUCE_EACH_19_(FN, X, ...) FN(X) JUCE_EACH_18_(FN, __VA_ARGS__) +#define JUCE_EACH_20_(FN, X, ...) FN(X) JUCE_EACH_19_(FN, __VA_ARGS__) +#define JUCE_EACH_21_(FN, X, ...) FN(X) JUCE_EACH_20_(FN, __VA_ARGS__) +#define JUCE_EACH_22_(FN, X, ...) FN(X) JUCE_EACH_21_(FN, __VA_ARGS__) +#define JUCE_EACH_23_(FN, X, ...) FN(X) JUCE_EACH_22_(FN, __VA_ARGS__) +#define JUCE_EACH_24_(FN, X, ...) FN(X) JUCE_EACH_23_(FN, __VA_ARGS__) +#define JUCE_EACH_25_(FN, X, ...) FN(X) JUCE_EACH_24_(FN, __VA_ARGS__) +#define JUCE_EACH_26_(FN, X, ...) FN(X) JUCE_EACH_25_(FN, __VA_ARGS__) +#define JUCE_EACH_27_(FN, X, ...) FN(X) JUCE_EACH_26_(FN, __VA_ARGS__) +#define JUCE_EACH_28_(FN, X, ...) FN(X) JUCE_EACH_27_(FN, __VA_ARGS__) +#define JUCE_EACH_29_(FN, X, ...) FN(X) JUCE_EACH_28_(FN, __VA_ARGS__) + +/** Apply the macro FN to each of the other arguments. */ +#define JUCE_EACH(FN, ...) \ + JUCE_NTH_ARG_(, ##__VA_ARGS__, \ + JUCE_EACH_29_, \ + JUCE_EACH_28_, \ + JUCE_EACH_27_, \ + JUCE_EACH_26_, \ + JUCE_EACH_25_, \ + JUCE_EACH_24_, \ + JUCE_EACH_23_, \ + JUCE_EACH_22_, \ + JUCE_EACH_21_, \ + JUCE_EACH_20_, \ + JUCE_EACH_19_, \ + JUCE_EACH_18_, \ + JUCE_EACH_17_, \ + JUCE_EACH_16_, \ + JUCE_EACH_15_, \ + JUCE_EACH_14_, \ + JUCE_EACH_13_, \ + JUCE_EACH_12_, \ + JUCE_EACH_11_, \ + JUCE_EACH_10_, \ + JUCE_EACH_09_, \ + JUCE_EACH_08_, \ + JUCE_EACH_07_, \ + JUCE_EACH_06_, \ + JUCE_EACH_05_, \ + JUCE_EACH_04_, \ + JUCE_EACH_03_, \ + JUCE_EACH_02_, \ + JUCE_EACH_01_, \ + JUCE_EACH_00_) \ + (FN, ##__VA_ARGS__) + +/** Concatenate two tokens to form a new token. */ +#define JUCE_CONCAT_(a, b) a##b +#define JUCE_CONCAT(a, b) JUCE_CONCAT_(a, b) + +/** Quote the argument, turning it into a string. */ +#define JUCE_TO_STRING(x) #x + +#if JUCE_CLANG || JUCE_GCC + #define JUCE_IGNORE_GCC_IMPL_(compiler, warning) + #define JUCE_IGNORE_GCC_IMPL_0(compiler, warning) + #define JUCE_IGNORE_GCC_IMPL_1(compiler, warning) \ + _Pragma(JUCE_TO_STRING(compiler diagnostic ignored warning)) + + /** If 'warning' is recognised by this compiler, ignore it. */ + #if defined (__has_warning) + #define JUCE_IGNORE_GCC_LIKE(compiler, warning) \ + JUCE_CONCAT(JUCE_IGNORE_GCC_IMPL_, __has_warning(warning))(compiler, warning) + #else + #define JUCE_IGNORE_GCC_LIKE(compiler, warning) \ + JUCE_IGNORE_GCC_IMPL_1(compiler, warning) + #endif + + /** Ignore GCC/clang-specific warnings. */ + #define JUCE_IGNORE_GCC(warning) JUCE_IGNORE_GCC_LIKE(GCC, warning) + #define JUCE_IGNORE_clang(warning) JUCE_IGNORE_GCC_LIKE(clang, warning) + + #define JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, ...) \ + _Pragma(JUCE_TO_STRING(compiler diagnostic push)) \ + JUCE_EACH(JUCE_CONCAT(JUCE_IGNORE_, compiler), ##__VA_ARGS__) + + /** Push a new warning scope, and then ignore each warning for either clang + or gcc. If the compiler doesn't support __has_warning, we add -Wpragmas + as the first disabled warning because otherwise we might get complaints + about unknown warning options. + */ + #if defined (__has_warning) + #define JUCE_PUSH_WARNINGS_GCC_LIKE(compiler, ...) \ + JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, ##__VA_ARGS__) + #else + #define JUCE_PUSH_WARNINGS_GCC_LIKE(compiler, ...) \ + JUCE_IGNORE_WARNINGS_GCC_LIKE(compiler, "-Wpragmas", ##__VA_ARGS__) + #endif + + /** Pop the current warning scope. */ + #define JUCE_POP_WARNINGS_GCC_LIKE(compiler) \ + _Pragma(JUCE_TO_STRING(compiler diagnostic pop)) + + /** Push/pop warnings on compilers with gcc-like warning flags. + These macros expand to nothing on other compilers (like MSVC). + */ + #if JUCE_CLANG + #define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...) JUCE_PUSH_WARNINGS_GCC_LIKE(clang, __VA_ARGS__) + #define JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_POP_WARNINGS_GCC_LIKE(clang) + #else + #define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...) JUCE_PUSH_WARNINGS_GCC_LIKE(GCC, __VA_ARGS__) + #define JUCE_END_IGNORE_WARNINGS_GCC_LIKE JUCE_POP_WARNINGS_GCC_LIKE(GCC) + #endif +#else + #define JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE(...) + #define JUCE_END_IGNORE_WARNINGS_GCC_LIKE +#endif + +/** Push/pop warnings on MSVC. These macros expand to nothing on other + compilers (like clang and gcc). +*/ +#if JUCE_MSVC + #define JUCE_IGNORE_MSVC(warnings) __pragma(warning(disable:warnings)) + #define JUCE_BEGIN_IGNORE_WARNINGS_LEVEL_MSVC(level, warnings) \ + __pragma(warning(push, level)) JUCE_IGNORE_MSVC(warnings) + #define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings) \ + __pragma(warning(push)) JUCE_IGNORE_MSVC(warnings) + #define JUCE_END_IGNORE_WARNINGS_MSVC __pragma(warning(pop)) +#else + #define JUCE_IGNORE_MSVC(warnings) + #define JUCE_BEGIN_IGNORE_WARNINGS_LEVEL_MSVC(level, warnings) + #define JUCE_BEGIN_IGNORE_WARNINGS_MSVC(warnings) + #define JUCE_END_IGNORE_WARNINGS_MSVC +#endif diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 0c2201cd27..a76783420c 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -20,6 +20,8 @@ ============================================================================== */ +#pragma once + namespace juce { diff --git a/modules/juce_core/system/juce_StandardHeader.h b/modules/juce_core/system/juce_StandardHeader.h index f90652400f..89938d9347 100644 --- a/modules/juce_core/system/juce_StandardHeader.h +++ b/modules/juce_core/system/juce_StandardHeader.h @@ -62,16 +62,18 @@ //============================================================================== #include "juce_CompilerSupport.h" +#include "juce_CompilerWarnings.h" #include "juce_PlatformDefs.h" //============================================================================== // Now we'll include some common OS headers.. +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4514 4245 4100) + #if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4514 4245 4100) #include #endif + #if JUCE_MAC || JUCE_IOS #include #include @@ -97,9 +99,7 @@ #include #endif -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC #if JUCE_MINGW #include diff --git a/modules/juce_core/text/juce_CharacterFunctions.cpp b/modules/juce_core/text/juce_CharacterFunctions.cpp index d1024f0871..88a3e63c64 100644 --- a/modules/juce_core/text/juce_CharacterFunctions.cpp +++ b/modules/juce_core/text/juce_CharacterFunctions.cpp @@ -23,10 +23,7 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4514 4996) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4514 4996) juce_wchar CharacterFunctions::toUpperCase (const juce_wchar character) noexcept { @@ -56,9 +53,7 @@ bool CharacterFunctions::isLowerCase (const juce_wchar character) noexcept #endif } -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== bool CharacterFunctions::isWhitespace (const char character) noexcept diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 48b1160826..fc6a33da98 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -23,10 +23,7 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4514 4996) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4514 4996) NewLine newLine; @@ -2142,9 +2139,7 @@ String String::fromUTF8 (const char* const buffer, int bufferSizeBytes) return {}; } -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== StringRef::StringRef() noexcept : text ((const String::CharPointerType::CharType*) "\0\0\0") diff --git a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp index 43045c457a..0508d260de 100644 --- a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp +++ b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp @@ -23,44 +23,21 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4309 4305 4365) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4309 4305 4365) namespace zlibNamespace { #if JUCE_INCLUDE_ZLIB_CODE - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wshadow" - #pragma clang diagnostic ignored "-Wdeprecated-register" - #pragma clang diagnostic ignored "-Wswitch-enum" - #if __has_warning ("-Wimplicit-fallthrough") - #pragma clang diagnostic ignored "-Wimplicit-fallthrough" - #endif - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #if __has_warning("-Wcomma") - #pragma clang diagnostic ignored "-Wcomma" - #endif - #endif - - #if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wshadow" - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #pragma GCC diagnostic ignored "-Wswitch-enum" - #pragma GCC diagnostic ignored "-Wswitch-default" - #pragma GCC diagnostic ignored "-Wredundant-decls" - #if __GNUC__ >= 7 - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" - #endif - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion", + "-Wsign-conversion", + "-Wshadow", + "-Wdeprecated-register", + "-Wswitch-enum", + "-Wswitch-default", + "-Wredundant-decls", + "-Wimplicit-fallthrough", + "-Wzero-as-null-pointer-constant", + "-Wcomma") #undef OS_CODE #undef fdopen @@ -93,13 +70,7 @@ namespace zlibNamespace #undef Dad #undef Len - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif - - #if JUCE_GCC - #pragma GCC diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #else #include JUCE_ZLIB_INCLUDE_PATH @@ -114,9 +85,7 @@ namespace zlibNamespace #endif } -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== // internal helper object that holds the zlib structures so they don't have to be diff --git a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h index cae289b56c..28fea83812 100644 --- a/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_avx_SIMDNativeOps.h @@ -23,10 +23,7 @@ namespace dsp #ifndef DOXYGEN -#if JUCE_GCC && (__GNUC__ >= 6) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wignored-attributes" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wignored-attributes") #ifdef _MSC_VER #define DECLARE_AVX_SIMD_CONST(type, name) \ @@ -651,9 +648,7 @@ struct SIMDNativeOps #endif -#if JUCE_GCC && (__GNUC__ >= 6) - #pragma GCC diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE } // namespace dsp } // namespace juce diff --git a/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h b/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h index 91dc529a7b..3b028f8fc9 100644 --- a/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_neon_SIMDNativeOps.h @@ -23,10 +23,7 @@ namespace dsp #ifndef DOXYGEN -#if JUCE_GCC && (__GNUC__ >= 6) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wignored-attributes" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wignored-attributes") #ifdef _MSC_VER #define DECLARE_NEON_SIMD_CONST(type, name) \ @@ -491,9 +488,7 @@ struct SIMDNativeOps #endif -#if JUCE_GCC && (__GNUC__ >= 6) - #pragma GCC diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE } // namespace dsp } // namespace juce diff --git a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h index 34314530a2..6c344b8a6d 100644 --- a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h +++ b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h @@ -23,10 +23,7 @@ namespace dsp #ifndef DOXYGEN -#if JUCE_GCC && (__GNUC__ >= 6) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wignored-attributes" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wignored-attributes") #ifdef _MSC_VER #define DECLARE_SSE_SIMD_CONST(type, name) \ @@ -719,9 +716,7 @@ struct SIMDNativeOps #endif -#if JUCE_GCC && (__GNUC__ >= 6) - #pragma GCC diagnostic pop -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE } // namespace dsp } // namespace juce diff --git a/modules/juce_events/juce_events.cpp b/modules/juce_events/juce_events.cpp index a29883f92a..29e4442f40 100644 --- a/modules/juce_events/juce_events.cpp +++ b/modules/juce_events/juce_events.cpp @@ -73,10 +73,7 @@ #include "native/juce_osx_MessageQueue.h" - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") #if JUCE_MAC #include "native/juce_mac_MessageManager.mm" @@ -84,9 +81,7 @@ #include "native/juce_ios_MessageManager.mm" #endif - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #elif JUCE_WINDOWS #include "native/juce_win32_Messaging.cpp" diff --git a/modules/juce_events/messages/juce_DeletedAtShutdown.cpp b/modules/juce_events/messages/juce_DeletedAtShutdown.cpp index feede821f1..9f77f77831 100644 --- a/modules/juce_events/messages/juce_DeletedAtShutdown.cpp +++ b/modules/juce_events/messages/juce_DeletedAtShutdown.cpp @@ -43,12 +43,9 @@ DeletedAtShutdown::~DeletedAtShutdown() getDeletedAtShutdownObjects().removeFirstMatchingValue (this); } -#if JUCE_MSVC - // Disable unreachable code warning, in case the compiler manages to figure out that - // you have no classes of DeletedAtShutdown that could throw an exception in their destructor. - #pragma warning (push) - #pragma warning (disable: 4702) -#endif +// Disable unreachable code warning, in case the compiler manages to figure out that +// you have no classes of DeletedAtShutdown that could throw an exception in their destructor. +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4702) void DeletedAtShutdown::deleteAll() { @@ -87,8 +84,6 @@ void DeletedAtShutdown::deleteAll() getDeletedAtShutdownObjects().clear(); // just to make sure the array doesn't have any memory still allocated } -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC } // namespace juce diff --git a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp index ae3c1c6119..70f78f5a6f 100644 --- a/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_JPEGLoader.cpp @@ -19,10 +19,7 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4365) -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4365) namespace jpeglibNamespace { @@ -31,37 +28,16 @@ namespace jpeglibNamespace typedef unsigned char boolean; #endif - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wconversion" - #pragma clang diagnostic ignored "-Wdeprecated-register" - #pragma clang diagnostic ignored "-Wcast-align" - #pragma clang diagnostic ignored "-Wswitch-enum" - #if __has_warning ("-Wimplicit-fallthrough") - #pragma clang diagnostic ignored "-Wimplicit-fallthrough" - #endif - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #if __has_warning("-Wcomma") - #pragma clang diagnostic ignored "-Wcomma" - #endif - #endif - - #if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wconversion" - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #pragma GCC diagnostic ignored "-Wswitch-enum" - #pragma GCC diagnostic ignored "-Wswitch-default" - #if __GNUC__ > 5 - #pragma GCC diagnostic ignored "-Wshift-negative-value" - #if __GNUC__ >= 7 - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" - #endif - #endif - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wconversion", + "-Wdeprecated-register", + "-Wsign-conversion", + "-Wcast-align", + "-Wswitch-enum", + "-Wswitch-default", + "-Wimplicit-fallthrough", + "-Wzero-as-null-pointer-constant", + "-Wshift-negative-value", + "-Wcomma") #define JPEG_INTERNALS #undef FAR @@ -136,13 +112,7 @@ namespace jpeglibNamespace #include "jpglib/jutils.c" #include "jpglib/transupp.c" - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif - - #if JUCE_GCC - #pragma GCC diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #else #define JPEG_INTERNALS #undef FAR @@ -153,9 +123,7 @@ namespace jpeglibNamespace #undef max #undef min -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== namespace JPEGHelpers diff --git a/modules/juce_graphics/image_formats/juce_PNGLoader.cpp b/modules/juce_graphics/image_formats/juce_PNGLoader.cpp index 7849adadbd..745db62fef 100644 --- a/modules/juce_graphics/image_formats/juce_PNGLoader.cpp +++ b/modules/juce_graphics/image_formats/juce_PNGLoader.cpp @@ -19,13 +19,7 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4390 4611 4365 4267) - #ifdef __INTEL_COMPILER - #pragma warning (disable: 2544 2545) - #endif -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4390 4611 4365 4267 4616 2544 2545) namespace zlibNamespace { @@ -55,28 +49,10 @@ namespace pnglibNamespace using std::free; #endif - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wsign-conversion" - #if __has_warning ("-Wimplicit-fallthrough") - #pragma clang diagnostic ignored "-Wimplicit-fallthrough" - #endif - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #if __has_warning("-Wcomma") - #pragma clang diagnostic ignored "-Wcomma" - #endif - #endif - - #if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wsign-conversion" - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #if __GNUC__ >= 7 - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" - #endif - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wsign-conversion", + "-Wimplicit-fallthrough", + "-Wzero-as-null-pointer-constant", + "-Wcomma") #undef check using std::abs; @@ -324,13 +300,7 @@ namespace pnglibNamespace #include "pnglib/pngwtran.c" #include "pnglib/pngwutil.c" - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif - - #if JUCE_GCC - #pragma GCC diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #else extern "C" @@ -345,9 +315,7 @@ namespace pnglibNamespace #undef min #undef fdopen -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC //============================================================================== namespace PNGHelpers @@ -378,10 +346,7 @@ namespace PNGHelpers static void JUCE_CDECL warningCallback (png_structp, png_const_charp) {} - #if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4611) // (warning about setjmp) - #endif + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4611) static bool readHeader (InputStream& in, png_structp pngReadStruct, png_infop pngInfoStruct, jmp_buf& errorJumpBuf, png_uint_32& width, png_uint_32& height, int& bitDepth, int& colorType, int& interlaceType) noexcept @@ -433,9 +398,7 @@ namespace PNGHelpers return false; } - #if JUCE_MSVC - #pragma warning (pop) - #endif + JUCE_END_IGNORE_WARNINGS_MSVC static Image createImageFromData (bool hasAlphaChan, int width, int height, png_bytepp rows) { diff --git a/modules/juce_graphics/juce_graphics.cpp b/modules/juce_graphics/juce_graphics.cpp index 8896bb2a97..98f7e97210 100644 --- a/modules/juce_graphics/juce_graphics.cpp +++ b/modules/juce_graphics/juce_graphics.cpp @@ -39,10 +39,7 @@ #elif JUCE_WINDOWS // get rid of some warnings in Window's own headers - #ifdef JUCE_MSVC - #pragma warning (push) - #pragma warning (disable : 4458) - #endif + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4458) #if JUCE_MINGW && JUCE_USE_DIRECTWRITE #warning "DirectWrite not currently implemented with mingw..." @@ -65,9 +62,7 @@ #include - #ifdef JUCE_MSVC - #pragma warning (pop) - #endif + JUCE_END_IGNORE_WARNINGS_MSVC #elif JUCE_IOS #import diff --git a/modules/juce_graphics/native/juce_RenderingHelpers.h b/modules/juce_graphics/native/juce_RenderingHelpers.h index 23f8ace99f..7be54d5f02 100644 --- a/modules/juce_graphics/native/juce_RenderingHelpers.h +++ b/modules/juce_graphics/native/juce_RenderingHelpers.h @@ -19,10 +19,7 @@ namespace juce { -#if JUCE_MSVC - #pragma warning (push) - #pragma warning (disable: 4127) // "expression is constant" warning -#endif +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4127) namespace RenderingHelpers { @@ -2732,8 +2729,6 @@ protected: } -#if JUCE_MSVC - #pragma warning (pop) -#endif +JUCE_END_IGNORE_WARNINGS_MSVC } // namespace juce diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp index c17a5e01bf..63eaff86a9 100644 --- a/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/modules/juce_gui_basics/juce_gui_basics.cpp @@ -263,11 +263,7 @@ namespace juce #endif #if JUCE_MAC || JUCE_IOS - - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") #if JUCE_IOS #include "native/juce_ios_UIViewComponentPeer.mm" @@ -285,9 +281,7 @@ namespace juce #include "native/juce_mac_FileChooser.mm" #endif - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #include "native/juce_mac_MouseCursor.mm" @@ -300,16 +294,11 @@ namespace juce #include "native/juce_linux_X11.cpp" #include "native/juce_linux_X11_Clipboard.cpp" - #if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant") #include "native/juce_linux_X11_Windowing.cpp" - #if JUCE_GCC - #pragma GCC diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #include "native/juce_linux_FileChooser.cpp" diff --git a/modules/juce_gui_basics/native/juce_MultiTouchMapper.h b/modules/juce_gui_basics/native/juce_MultiTouchMapper.h index 1937d9169f..27e9f53e5b 100644 --- a/modules/juce_gui_basics/native/juce_MultiTouchMapper.h +++ b/modules/juce_gui_basics/native/juce_MultiTouchMapper.h @@ -16,12 +16,7 @@ ============================================================================== */ -#if JUCE_CLANG - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant") namespace juce { @@ -102,8 +97,4 @@ private: } // namespace juce -#if JUCE_CLANG - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic pop - #endif -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp index 4e16e71c45..edeeeed860 100644 --- a/modules/juce_gui_extra/juce_gui_extra.cpp +++ b/modules/juce_gui_extra/juce_gui_extra.cpp @@ -93,32 +93,11 @@ #include #include - #if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #if __GNUC__ > 7 - #pragma GCC diagnostic ignored "-Wparentheses" - #endif - #endif - - #if JUCE_CLANG - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant", "-Wparentheses") #include - #if JUCE_GCC - #pragma GCC diagnostic pop - #endif - - #if JUCE_CLANG - #if __has_warning("-Wzero-as-null-pointer-constant") - #pragma clang diagnostic pop - #endif - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #include #include @@ -147,10 +126,7 @@ //============================================================================== #if JUCE_MAC || JUCE_IOS - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") #if JUCE_MAC #include "native/juce_mac_NSViewComponent.mm" @@ -166,9 +142,7 @@ #include "native/juce_mac_WebBrowserComponent.mm" #endif - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE //============================================================================== #elif JUCE_WINDOWS @@ -180,10 +154,7 @@ //============================================================================== #elif JUCE_LINUX - #if JUCE_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant") #include "native/juce_linux_XEmbedComponent.cpp" @@ -191,9 +162,7 @@ #include "native/juce_linux_X11_WebBrowserComponent.cpp" #endif - #if JUCE_GCC - #pragma GCC diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #include "native/juce_linux_X11_SystemTrayIcon.cpp" diff --git a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp index 2f56128e19..38cdd06fbc 100644 --- a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp @@ -19,11 +19,7 @@ namespace juce { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunguarded-availability" -#if JUCE_CLANG && defined (MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14 - #pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wunguarded-availability", "-Wdeprecated-declarations") extern NSMenu* createNSMenu (const PopupMenu&, const String& name, int topLevelMenuId, int topLevelIndex, bool addDelegate); @@ -431,6 +427,6 @@ void SystemTrayIconComponent::showDropdownMenu (const PopupMenu& menu) pimpl->statusItemHolder->showMenu (menu); } -#pragma clang diagnostic pop +JUCE_END_IGNORE_WARNINGS_GCC_LIKE } // namespace juce diff --git a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm index 5f1a53025d..367c9002ec 100644 --- a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm @@ -16,11 +16,7 @@ ============================================================================== */ -#if JUCE_CLANG && ! (defined (MAC_OS_X_VERSION_10_16) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_16) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wdeprecated-declarations" - #define JUCE_DEPRECATION_IGNORED 1 -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") #if JUCE_MAC @@ -357,10 +353,7 @@ private: #endif }; -#if JUCE_DEPRECATION_IGNORED - #pragma clang diagnostic pop - #undef JUCE_DEPRECATION_IGNORED -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE //============================================================================== WebBrowserComponent::WebBrowserComponent (bool unloadWhenHidden) diff --git a/modules/juce_opengl/juce_opengl.cpp b/modules/juce_opengl/juce_opengl.cpp index c35d1118f7..4356938141 100644 --- a/modules/juce_opengl/juce_opengl.cpp +++ b/modules/juce_opengl/juce_opengl.cpp @@ -255,10 +255,7 @@ private: //============================================================================== #if JUCE_MAC || JUCE_IOS - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") #if JUCE_MAC #include "native/juce_OpenGL_osx.h" @@ -266,9 +263,7 @@ private: #include "native/juce_OpenGL_ios.h" #endif - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #elif JUCE_WINDOWS #include "native/juce_OpenGL_win32.h" diff --git a/modules/juce_opengl/native/juce_OpenGL_osx.h b/modules/juce_opengl/native/juce_OpenGL_osx.h index d6800810a4..c38612cdac 100644 --- a/modules/juce_opengl/native/juce_OpenGL_osx.h +++ b/modules/juce_opengl/native/juce_OpenGL_osx.h @@ -19,11 +19,7 @@ namespace juce { -#if JUCE_CLANG && ! (defined (MAC_OS_X_VERSION_10_16) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_16) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wdeprecated-declarations" - #define JUCE_DEPRECATION_IGNORED 1 -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") class OpenGLContext::NativeContext { @@ -258,9 +254,6 @@ bool OpenGLHelpers::isContextActive() return CGLGetCurrentContext() != CGLContextObj(); } -#if JUCE_DEPRECATION_IGNORED - #pragma clang diagnostic pop - #undef JUCE_DEPRECATION_IGNORED -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE } // namespace juce diff --git a/modules/juce_video/capture/juce_CameraDevice.cpp b/modules/juce_video/capture/juce_CameraDevice.cpp index 93d4b2a941..f5409bb56f 100644 --- a/modules/juce_video/capture/juce_CameraDevice.cpp +++ b/modules/juce_video/capture/juce_CameraDevice.cpp @@ -24,16 +24,11 @@ namespace juce #elif JUCE_WINDOWS #include "../native/juce_win32_CameraDevice.h" #elif JUCE_IOS - #if JUCE_CLANG - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wunguarded-availability-new" - #endif + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wunguarded-availability-new") #include "../native/juce_ios_CameraDevice.h" - #if JUCE_CLANG - #pragma clang diagnostic pop - #endif + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #elif JUCE_ANDROID #include "../native/juce_android_CameraDevice.h" #endif diff --git a/modules/juce_video/native/juce_ios_CameraDevice.h b/modules/juce_video/native/juce_ios_CameraDevice.h index 7a85642608..81188ef06b 100644 --- a/modules/juce_video/native/juce_ios_CameraDevice.h +++ b/modules/juce_video/native/juce_ios_CameraDevice.h @@ -330,8 +330,7 @@ private: delegate.reset ([cls.createInstance() init]); SessionDelegateClass::setOwner (delegate.get(), this); - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] addObserver: delegate.get() selector: @selector (sessionDidStartRunning:) name: AVCaptureSessionDidStartRunningNotification @@ -356,7 +355,7 @@ private: selector: @selector (sessionInterruptionEnded:) name: AVCaptureSessionInterruptionEndedNotification object: captureSession.get()]; - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE dispatch_async (captureSessionQueue,^ { @@ -517,14 +516,13 @@ private: { SessionDelegateClass() : ObjCClass ("SessionDelegateClass_") { - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (sessionDidStartRunning:), started, "v@:@"); addMethod (@selector (sessionDidStopRunning:), stopped, "v@:@"); addMethod (@selector (sessionRuntimeError:), runtimeError, "v@:@"); addMethod (@selector (sessionWasInterrupted:), interrupted, "v@:@"); addMethod (@selector (sessionInterruptionEnded:), interruptionEnded, "v@:@"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); diff --git a/modules/juce_video/native/juce_mac_CameraDevice.h b/modules/juce_video/native/juce_mac_CameraDevice.h index 881cb7ec68..ed9badca8e 100644 --- a/modules/juce_video/native/juce_mac_CameraDevice.h +++ b/modules/juce_video/native/juce_mac_CameraDevice.h @@ -16,11 +16,7 @@ ============================================================================== */ -#if JUCE_CLANG && ! (defined (MAC_OS_X_VERSION_10_16) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_16) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wdeprecated-declarations" - #define JUCE_DEPRECATION_IGNORED 1 -#endif +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") struct CameraDevice::Pimpl { @@ -327,7 +323,4 @@ String CameraDevice::getFileExtension() return ".mov"; } -#if JUCE_DEPRECATION_IGNORED - #pragma clang diagnostic pop - #undef JUCE_DEPRECATION_IGNORED -#endif +JUCE_END_IGNORE_WARNINGS_GCC_LIKE diff --git a/modules/juce_video/native/juce_mac_Video.h b/modules/juce_video/native/juce_mac_Video.h index 2a4a347334..7bac3d65a5 100644 --- a/modules/juce_video/native/juce_mac_Video.h +++ b/modules/juce_video/native/juce_mac_Video.h @@ -198,10 +198,9 @@ private: { JucePlayerStatusObserverClass() : ObjCClass ("JucePlayerStatusObserverClass_") { - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (observeValueForKeyPath:ofObject:change:context:), valueChanged, "v@:@@@?"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); @@ -243,10 +242,9 @@ private: { JucePlayerItemPlaybackStatusObserverClass() : ObjCClass ("JucePlayerItemPlaybackStatusObserverClass_") { - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (processNotification:), notificationReceived, "v@:@"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); @@ -299,10 +297,9 @@ private: { JucePlayerItemPreparationStatusObserverClass() : ObjCClass ("JucePlayerItemStatusObserverClass_") { - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (observeValueForKeyPath:ofObject:change:context:), valueChanged, "v@:@@@?"); - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); @@ -496,21 +493,19 @@ private: void attachPlaybackObserver() { - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] addObserver: playerItemPlaybackStatusObserver.get() selector: @selector (processNotification:) name: AVPlayerItemDidPlayToEndTimeNotification object: [crtp().getPlayer() currentItem]]; - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } void detachPlaybackObserver() { - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wundeclared-selector" + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] removeObserver: playerItemPlaybackStatusObserver.get()]; - #pragma clang diagnostic pop + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } private: