Bläddra i källkod

Win32: Fix some of the errors for Null-only on VS

This workaround is needed whenever windows.h is included after glfw3.h.
Camilla Löwy 1 år sedan
förälder
incheckning
9f6da7e7c6
2 ändrade filer med 10 tillägg och 0 borttagningar
  1. 5 0
      src/win32_thread.h
  2. 5 0
      src/win32_time.h

+ 5 - 0
src/win32_thread.h

@@ -25,6 +25,11 @@
 //
 //
 //========================================================================
 //========================================================================
 
 
+// This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
+// example to allow applications to correctly declare a GL_KHR_debug callback)
+// but windows.h assumes no one will define APIENTRY before it does
+#undef APIENTRY
+
 #include <windows.h>
 #include <windows.h>
 
 
 #define GLFW_WIN32_TLS_STATE            _GLFWtlsWin32     win32;
 #define GLFW_WIN32_TLS_STATE            _GLFWtlsWin32     win32;

+ 5 - 0
src/win32_time.h

@@ -25,6 +25,11 @@
 //
 //
 //========================================================================
 //========================================================================
 
 
+// This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
+// example to allow applications to correctly declare a GL_KHR_debug callback)
+// but windows.h assumes no one will define APIENTRY before it does
+#undef APIENTRY
+
 #include <windows.h>
 #include <windows.h>
 
 
 #define GLFW_WIN32_LIBRARY_TIMER_STATE  _GLFWtimerWin32   win32;
 #define GLFW_WIN32_LIBRARY_TIMER_STATE  _GLFWtimerWin32   win32;