DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 0aa4fd4854250569c09b956dbb45c3acfd53316a
parent ccece16081c89ead759394994f7251092938837e
Author: lucianoiam <oss@lucianoiam.com>
Date:   Sat, 11 Sep 2021 16:11:48 +0200

Prevent some compilation warnings on MinGW (#324)

* Prevent some compilation warnings on MinGW

* Narrower scope for fix in 39bf2c5

* Repeat 1994d33 for pugl.cpp
Diffstat:
Mdgl/src/pugl.cpp | 7+++++++
Mdistrho/src/DistrhoUI.cpp | 7+++++++
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp @@ -213,10 +213,17 @@ double puglGetDesktopScaleFactor(const PuglView* const view) typedef HRESULT(WINAPI* PFN_GetProcessDpiAwareness)(HANDLE, DWORD*); typedef HRESULT(WINAPI* PFN_GetScaleFactorForMonitor)(HMONITOR, DWORD*); +# if defined(__GNUC__) && (__GNUC__ >= 9) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +# endif const PFN_GetProcessDpiAwareness GetProcessDpiAwareness = (PFN_GetProcessDpiAwareness)GetProcAddress(Shcore, "GetProcessDpiAwareness"); const PFN_GetScaleFactorForMonitor GetScaleFactorForMonitor = (PFN_GetScaleFactorForMonitor)GetProcAddress(Shcore, "GetScaleFactorForMonitor"); +# if defined(__GNUC__) && (__GNUC__ >= 9) +# pragma GCC diagnostic pop +# endif DWORD dpiAware = 0; if (GetProcessDpiAwareness && GetScaleFactorForMonitor diff --git a/distrho/src/DistrhoUI.cpp b/distrho/src/DistrhoUI.cpp @@ -58,10 +58,17 @@ static double getDesktopScaleFactor(const uintptr_t parentWindowHandle) typedef HRESULT(WINAPI* PFN_GetProcessDpiAwareness)(HANDLE, DWORD*); typedef HRESULT(WINAPI* PFN_GetScaleFactorForMonitor)(HMONITOR, DWORD*); +# if defined(__GNUC__) && (__GNUC__ >= 9) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wcast-function-type" +# endif const PFN_GetProcessDpiAwareness GetProcessDpiAwareness = (PFN_GetProcessDpiAwareness)GetProcAddress(Shcore, "GetProcessDpiAwareness"); const PFN_GetScaleFactorForMonitor GetScaleFactorForMonitor = (PFN_GetScaleFactorForMonitor)GetProcAddress(Shcore, "GetScaleFactorForMonitor"); +# if defined(__GNUC__) && (__GNUC__ >= 9) +# pragma GCC diagnostic pop +# endif DWORD dpiAware = 0; if (GetProcessDpiAwareness && GetScaleFactorForMonitor