From 9f6da7e7c64572436fcd56022f4147270f47deef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 10 Jan 2024 00:47:18 +0100 Subject: [PATCH] Win32: Fix some of the errors for Null-only on VS This workaround is needed whenever windows.h is included after glfw3.h. --- src/win32_thread.h | 5 +++++ src/win32_time.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/win32_thread.h b/src/win32_thread.h index 4b5a696f..dd5948f0 100644 --- a/src/win32_thread.h +++ b/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 #define GLFW_WIN32_TLS_STATE _GLFWtlsWin32 win32; diff --git a/src/win32_time.h b/src/win32_time.h index da5afa41..ef57a5a6 100644 --- a/src/win32_time.h +++ b/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 #define GLFW_WIN32_LIBRARY_TIMER_STATE _GLFWtimerWin32 win32;