From 45d9a290bc5486e317ffe60f4af2ced3ed66d9c7 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 13 Jun 2021 21:28:31 +0100 Subject: [PATCH] Fix (ignore) some compiler warnings Signed-off-by: falkTX --- dgl/src/NanoVG.cpp | 4 ++-- distrho/extra/LibraryUtils.hpp | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dgl/src/NanoVG.cpp b/dgl/src/NanoVG.cpp index 13d6d5fa..3c5bf9a6 100644 --- a/dgl/src/NanoVG.cpp +++ b/dgl/src/NanoVG.cpp @@ -89,7 +89,7 @@ DGL_EXT(PFNGLBLENDFUNCSEPARATEPROC, glBlendFuncSeparate) static NVGcontext* nvgCreateGL_helper(int flags) { #if defined(DISTRHO_OS_WINDOWS) -# if defined(__GNUC__) && (__GNUC__ >= 10) +# if defined(__GNUC__) && (__GNUC__ >= 9) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wcast-function-type" # endif @@ -127,7 +127,7 @@ DGL_EXT(PFNGLVERTEXATTRIBPOINTERPROC, glVertexAttribPointer) DGL_EXT(PFNGLBLENDFUNCSEPARATEPROC, glBlendFuncSeparate) # undef DGL_EXT needsInit = false; -# if defined(__GNUC__) && (__GNUC__ >= 10) +# if defined(__GNUC__) && (__GNUC__ >= 9) # pragma GCC diagnostic pop # endif #endif diff --git a/distrho/extra/LibraryUtils.hpp b/distrho/extra/LibraryUtils.hpp index 2fc905e9..7faca7ce 100644 --- a/distrho/extra/LibraryUtils.hpp +++ b/distrho/extra/LibraryUtils.hpp @@ -20,6 +20,7 @@ #include "../DistrhoUtils.hpp" #ifdef DISTRHO_OS_WINDOWS +# include # include typedef HMODULE lib_t; #else @@ -79,7 +80,14 @@ Func lib_symbol(const lib_t lib, const char* const symbol) noexcept try { #ifdef DISTRHO_OS_WINDOWS +# if defined(__GNUC__) && (__GNUC__ >= 9) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +# endif return (Func)::GetProcAddress(lib, symbol); +# if defined(__GNUC__) && (__GNUC__ >= 9) +# pragma GCC diagnostic pop +# endif #else return (Func)(uintptr_t)::dlsym(lib, symbol); #endif