From 9d3a3c32d68128a675bb458589fdd75b061fa989 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 5 Nov 2015 12:08:27 +0100 Subject: [PATCH] Replace hardcoded version number with macro --- src/internal.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/internal.h b/src/internal.h index 2410b075..a8feea8a 100644 --- a/src/internal.h +++ b/src/internal.h @@ -33,8 +33,6 @@ #include "glfw_config.h" #endif -#define _GLFW_VERSION_NUMBER "3.2.0" - #if defined(GLFW_INCLUDE_GLCOREARB) || \ defined(GLFW_INCLUDE_ES1) || \ defined(GLFW_INCLUDE_ES2) || \ @@ -134,6 +132,13 @@ typedef int GLFWbool; // Helper macros //======================================================================== +// Constructs a version number string from the public header macros +#define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r +#define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r) +#define _GLFW_VERSION_NUMBER _GLFW_MAKE_VERSION(GLFW_VERSION_MAJOR, \ + GLFW_VERSION_MINOR, \ + GLFW_VERSION_REVISION) + // Checks for whether the library has been initialized #define _GLFW_REQUIRE_INIT() \ if (!_glfwInitialized) \