From 994d8ae54d76c2d3b780a46560f175ec005da210 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 10 Nov 2015 14:57:30 +0100 Subject: [PATCH] Relax native access header constraints --- README.md | 1 + include/GLFW/glfw3native.h | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cfeca311..8480b67e 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ used by the tests and examples and are not required to build the library. - Added `GLFW_CONTEXT_NO_ERROR` context hint for `GL_KHR_no_error` support - Added `GLFW_TRUE` and `GLFW_FALSE` as client API independent boolean values - Added `glfwGetGLXWindow` to query the `GLXWindow` of a window + - Relaxed rules for native access header macros - Removed dependency on external OpenGL or OpenGL ES headers - [Win32] Added support for Windows 8.1 per-monitor DPI - [Cocoa] Removed support for OS X 10.6 diff --git a/include/GLFW/glfw3native.h b/include/GLFW/glfw3native.h index 906699b1..c68e31a7 100644 --- a/include/GLFW/glfw3native.h +++ b/include/GLFW/glfw3native.h @@ -50,9 +50,8 @@ extern "C" { * doing and how to fix problems caused by using them. If you don't, you * shouldn't be using them.** * - * Before the inclusion of @ref glfw3native.h, you must define exactly one - * window system API macro and exactly one context creation API macro. Failure - * to do this will cause a compile-time error. + * Before the inclusion of @ref glfw3native.h, you may define exactly one + * window system API macro and zero or more context creation API macros. * * The chosen backends must match those the library was compiled for. Failure * to do this will cause a link-time error. @@ -101,20 +100,19 @@ extern "C" { #include #elif defined(GLFW_EXPOSE_NATIVE_MIR) #include -#else - #error "No window API selected" #endif #if defined(GLFW_EXPOSE_NATIVE_WGL) /* WGL is declared by windows.h */ -#elif defined(GLFW_EXPOSE_NATIVE_NSGL) +#endif +#if defined(GLFW_EXPOSE_NATIVE_NSGL) /* NSGL is declared by Cocoa.h */ -#elif defined(GLFW_EXPOSE_NATIVE_GLX) +#endif +#if defined(GLFW_EXPOSE_NATIVE_GLX) #include -#elif defined(GLFW_EXPOSE_NATIVE_EGL) +#endif +#if defined(GLFW_EXPOSE_NATIVE_EGL) #include -#else - #error "No context API selected" #endif