瀏覽代碼

Merge pull request #35193 from akien-mga/i-live-in-the-void

MinGW: Avoid GCC -Wcast-function-type warnings on GetProcAddress
Rémi Verschelde 5 年之前
父節點
當前提交
6135037551
共有 3 個文件被更改,包括 15 次插入0 次删除
  1. 5 0
      platform/windows/context_gl_windows.cpp
  2. 5 0
      platform/windows/joypad_windows.cpp
  3. 5 0
      platform/windows/os_windows.cpp

+ 5 - 0
platform/windows/context_gl_windows.cpp

@@ -43,6 +43,11 @@
 #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
 #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
 
+#if defined(__GNUC__)
+// Workaround GCC warning from -Wcast-function-type.
+#define wglGetProcAddress (void *)wglGetProcAddress
+#endif
+
 typedef HGLRC(APIENTRY *PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int *);
 
 void ContextGL_Windows::release_current() {

+ 5 - 0
platform/windows/joypad_windows.cpp

@@ -37,6 +37,11 @@
 #define __builtin_bswap32 _byteswap_ulong
 #endif
 
+#if defined(__GNUC__)
+// Workaround GCC warning from -Wcast-function-type.
+#define GetProcAddress (void *)GetProcAddress
+#endif
+
 DWORD WINAPI _xinput_get_state(DWORD dwUserIndex, XINPUT_STATE *pState) {
 	return ERROR_DEVICE_NOT_CONNECTED;
 }

+ 5 - 0
platform/windows/os_windows.cpp

@@ -74,6 +74,11 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
 #define WM_POINTERUPDATE 0x0245
 #endif
 
+#if defined(__GNUC__)
+// Workaround GCC warning from -Wcast-function-type.
+#define GetProcAddress (void *)GetProcAddress
+#endif
+
 typedef struct {
 	int count;
 	int screen;