# HG changeset patch # User glx22 # Date 2021-05-14 13:41:00 # Node ID 8c500d511c416521b92ec5739c0c1d62f177d2b1 # Parent 182cff790b447d897a76703a11a7e0469091f0ac Fix: [MinGW] Ignore wglGetProcAddress() cast warnings diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -1265,6 +1265,12 @@ static void LoadWGLExtensions() if (rc != nullptr) { wglMakeCurrent(dc, rc); +#ifdef __MINGW32__ + /* GCC doesn't understand the expected usage of wglGetProcAddress(). */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-function-type" +#endif /* __MINGW32__ */ + /* Get list of WGL extensions. */ PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB"); if (wglGetExtensionsStringARB != nullptr) { @@ -1279,6 +1285,9 @@ static void LoadWGLExtensions() } } +#ifdef __MINGW32__ +#pragma GCC diagnostic pop +#endif wglMakeCurrent(nullptr, nullptr); wglDeleteContext(rc); }