From a23bab971ee05e5507822d51bcf2f448879d6a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sat, 14 Jan 2023 03:49:49 +0000 Subject: [PATCH] MinGW: Disable -Wcast-function-type warnings --- ui/win32/file_dlg_win32.cpp | 2 ++ wsutil/os_version_info.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ui/win32/file_dlg_win32.cpp b/ui/win32/file_dlg_win32.cpp index 53e6b92c4e..84f363a756 100644 --- a/ui/win32/file_dlg_win32.cpp +++ b/ui/win32/file_dlg_win32.cpp @@ -94,6 +94,7 @@ static GetThreadDpiAwarenessContextProc GetThreadDpiAwarenessContextP; static SetThreadDpiAwarenessContextProc SetThreadDpiAwarenessContextP; static gboolean got_proc_addresses = FALSE; +DIAG_OFF(cast-function-type) static gboolean get_proc_addresses(void) { if (got_proc_addresses) return TRUE; @@ -111,6 +112,7 @@ static gboolean get_proc_addresses(void) { got_proc_addresses = got_all; return got_all; } +DIAG_ON(cast-function-type) // Enabling DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 causes issues // when dragging our open file dialog between differently-DPIed diff --git a/wsutil/os_version_info.c b/wsutil/os_version_info.c index ea727be77a..96185d4602 100644 --- a/wsutil/os_version_info.c +++ b/wsutil/os_version_info.c @@ -208,7 +208,9 @@ get_os_version_info(GString *str) HMODULE ntdll_module = LoadLibrary(_T("ntdll.dll")); if (ntdll_module) { +DIAG_OFF(cast-function-type) RtlGetVersionP = (RtlGetVersionProc) GetProcAddress(ntdll_module, "RtlGetVersion"); +DIAG_ON(cast-function-type) } if (RtlGetVersionP) {