mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +00:00
Fix APIENTRY from windows.h being undefined
Some extension loader headers include windows.h. If they were included before glfw3.h, glfw3native.h would leave APIENTRY undefined. This adds the GLFW_APIENTRY_DEFINED macro to signal when GLFW "owns" APIENTRY and may undefine it. Fixes #1062.
This commit is contained in:
@@ -105,6 +105,7 @@ extern "C" {
|
||||
#else
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#define GLFW_APIENTRY_DEFINED
|
||||
#endif /* APIENTRY */
|
||||
|
||||
/* Some Windows OpenGL headers need this.
|
||||
|
||||
@@ -86,7 +86,10 @@ extern "C" {
|
||||
// This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
|
||||
// example to allow applications to correctly declare a GL_ARB_debug_output
|
||||
// callback) but windows.h assumes no one will define APIENTRY before it does
|
||||
#undef APIENTRY
|
||||
#if defined(GLFW_APIENTRY_DEFINED)
|
||||
#undef APIENTRY
|
||||
#undef GLFW_APIENTRY_DEFINED
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
Reference in New Issue
Block a user