From f62a5ca9ea0dc114e8adc3977151a809b1e85204 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 10 Nov 2022 15:44:37 +0100 Subject: [PATCH] Platform: silence Sdl2App warning on --- src/Magnum/Platform/Sdl2Application.cpp | 7 +++++++ src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 57b0d8b7f..d1aa8e8ef 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -27,6 +27,10 @@ #include "Sdl2Application.h" +#ifdef CORRADE_TARGET_GCC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" +#endif #ifdef CORRADE_TARGET_CLANG_CL /* SDL does #pragma pack(push,8) and #pragma pack(pop,8) in different headers (begin_code.h and end_code.h) and clang-cl doesn't like that, even though it @@ -38,6 +42,9 @@ #ifdef CORRADE_TARGET_CLANG_CL #pragma clang diagnostic pop #endif +#ifdef CORRADE_TARGET_GCC +#pragma GCC diagnostic pop +#endif #ifndef CORRADE_TARGET_EMSCRIPTEN #include #else diff --git a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp index c40683af8..d3804b5d5 100644 --- a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp +++ b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp @@ -34,6 +34,10 @@ #include "Magnum/Trade/AbstractImporter.h" #include "Magnum/Trade/ImageData.h" +#ifdef CORRADE_TARGET_GCC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" +#endif #ifdef CORRADE_TARGET_CLANG_CL /* SDL does #pragma pack(push,8) and #pragma pack(pop,8) in different headers (begin_code.h and end_code.h) and clang-cl doesn't like that, even though it @@ -45,6 +49,9 @@ #ifdef CORRADE_TARGET_CLANG_CL #pragma clang diagnostic pop #endif +#ifdef CORRADE_TARGET_GCC +#pragma GCC diagnostic pop +#endif #ifdef MAGNUM_TARGET_GL #include "Magnum/GL/DefaultFramebuffer.h"