mirror of https://github.com/OpenTTD/OpenTTD
Fix: [MinGW] Ignore wglGetProcAddress() cast warnings
parent
744a9e4745
commit
d485b50813
|
@ -1265,6 +1265,12 @@ static void LoadWGLExtensions()
|
||||||
if (rc != nullptr) {
|
if (rc != nullptr) {
|
||||||
wglMakeCurrent(dc, rc);
|
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. */
|
/* Get list of WGL extensions. */
|
||||||
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
|
PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
|
||||||
if (wglGetExtensionsStringARB != nullptr) {
|
if (wglGetExtensionsStringARB != nullptr) {
|
||||||
|
@ -1279,6 +1285,9 @@ static void LoadWGLExtensions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
wglMakeCurrent(nullptr, nullptr);
|
wglMakeCurrent(nullptr, nullptr);
|
||||||
wglDeleteContext(rc);
|
wglDeleteContext(rc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue