From 1bc7943560a370ada21a2b8a0bee06a9dbd1e61c Mon Sep 17 00:00:00 2001 From: andheh <36114788+andheh@users.noreply.github.com> Date: Thu, 15 Feb 2018 13:31:50 +0100 Subject: [PATCH] fixed "unknown pragma" warnings for GCC --- lib-src/header-substitutes/allegro.h | 11 ++++++++++- lib-src/header-substitutes/sbsms.h | 10 +++++++++- src/AudacityApp.cpp | 5 +++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib-src/header-substitutes/allegro.h b/lib-src/header-substitutes/allegro.h index d1667b4dc..ced995a64 100644 --- a/lib-src/header-substitutes/allegro.h +++ b/lib-src/header-substitutes/allegro.h @@ -2,7 +2,16 @@ // Indirectly include Allegro header so that we can disable warnings about unused parameters // when compiling Audacity itself. +#ifdef _MSC_VER +// If this is compiled with MSVC (Visual Studio) + #pragma warning( push ) #pragma warning( disable : 4100) #include "../portsmf/allegro.h" -#pragma warning( pop ) +#pragma warning( pop ) + +#else //_MSC_VER + +#include "../portsmf/allegro.h" + +#endif //_MSC_VER diff --git a/lib-src/header-substitutes/sbsms.h b/lib-src/header-substitutes/sbsms.h index 814316624..d9b830cd0 100644 --- a/lib-src/header-substitutes/sbsms.h +++ b/lib-src/header-substitutes/sbsms.h @@ -2,7 +2,15 @@ // Indirectly include SBSMS header so that we can disable warnings about unused parameters // when compiling Audacity itself. +#ifdef _MSC_VER +// If this is compiled with MSVC (Visual Studio) #pragma warning( push ) #pragma warning( disable : 4100) #include "../sbsms/include/sbsms.h" -#pragma warning( pop ) +#pragma warning( pop ) + +#else //_MSC_VER + +#include "../sbsms/include/sbsms.h" + +#endif //_MSC_VER diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index f0f512fd9..2e1a261ec 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -1064,8 +1064,11 @@ void AudacityApp::OnFatalException() } +#ifdef _MSC_VER +// If this is compiled with MSVC (Visual Studio) #pragma warning( push ) #pragma warning( disable : 4702) // unreachable code warning. +#endif //_MSC_VER bool AudacityApp::OnExceptionInMainLoop() { @@ -1109,7 +1112,9 @@ bool AudacityApp::OnExceptionInMainLoop() // Shouldn't ever reach this line return false; } +#ifdef _MSC_VER #pragma warning( pop ) +#endif //_MSC_VER #if defined(EXPERIMENTAL_CRASH_REPORT) void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)