From 4706891cae7d7b07ab7f85aee9d858bdd11d4f42 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sun, 22 Jan 2023 09:29:29 -0500 Subject: [PATCH] Add RAYLIB_VERSION numbers to raylib.h (#2856) Ran into an issue in raylib-cpp where a user was using raylib 4.5-dev, even though the library currently only targets 4.2. With having RAYLIB_VERSION_MAJOR and RAYLIB_VERSION_MINOR, we will be able to target different versions of raylib in different ways, via C preprocessor conditionals. For example: ``` c newColor = ColorTint(BLUE, RED); TraceLog(LOG_INFO, "The color should be tinted, but this isn't supported in ryalib <= 4.2"); ``` --- src/raylib.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/raylib.h b/src/raylib.h index 1c3f77669..10e69acdf 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -81,6 +81,9 @@ #include // Required for: va_list - Only used by TraceLogCallback +#define RAYLIB_VERSION_MAJOR 4 +#define RAYLIB_VERSION_MINOR 5 +#define RAYLIB_VERSION_PATCH 0 #define RAYLIB_VERSION "4.5-dev" // Function specifiers in case library is build/used as a shared library (Windows)