Browse Source

Prevent some compilation warnings on MinGW (#324)

* Prevent some compilation warnings on MinGW

* Narrower scope for fix in 39bf2c5

* Repeat 1994d33 for pugl.cpp
pull/327/head
lucianoiam GitHub 4 years ago
parent
commit
0aa4fd4854
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions
  1. +7
    -0
      dgl/src/pugl.cpp
  2. +7
    -0
      distrho/src/DistrhoUI.cpp

+ 7
- 0
dgl/src/pugl.cpp View File

@@ -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


+ 7
- 0
distrho/src/DistrhoUI.cpp View File

@@ -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


Loading…
Cancel
Save