From 42b52ecdb1b9e0a6bb625215e59e917dbe93dfe4 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Thu, 16 Aug 2018 11:29:30 +0100 Subject: [PATCH 1/3] Raymath dllexport fix - Added __declspec(dllexport) to RMDEF in raymath.h. This allows them to be accessed when importing from raylib.dll. --- src/raymath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raymath.h b/src/raymath.h index c2dc1cf4..4cbf3f4d 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -60,7 +60,7 @@ #endif #ifdef RAYMATH_IMPLEMENTATION - #define RMDEF extern inline // Provide external definition + #define RMDEF __declspec(dllexport) extern inline // Provide external definition #elif defined RAYMATH_HEADER_ONLY #define RMDEF static inline // Functions may be inlined, no external out-of-line definition #else From a187361c6f1737204babc0db389d7feb03a3de36 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Thu, 16 Aug 2018 12:54:45 +0100 Subject: [PATCH 2/3] Raymath dllexport fix if _WIN32 defined - Added check for dllexport to compile if _WIN32 defined. - If not defined then use the original RMDEF. --- src/raymath.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/raymath.h b/src/raymath.h index 4cbf3f4d..b4e0336a 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -60,7 +60,11 @@ #endif #ifdef RAYMATH_IMPLEMENTATION - #define RMDEF __declspec(dllexport) extern inline // Provide external definition + #if defined(_WIN32) + #define RMDEF __declspec(dllexport) extern inline // Provide external definition + #else + #define RMDEF extern inline + #endif #elif defined RAYMATH_HEADER_ONLY #define RMDEF static inline // Functions may be inlined, no external out-of-line definition #else From c669c6762fe14b09c8390067f3b07b12eba05e05 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Thu, 16 Aug 2018 18:20:49 +0100 Subject: [PATCH 3/3] Improved raymath defines - Using raylib.h as reference, added define checks for BUILD_LIBTYPE_SHARED and USE_LIBTYPE_SHARED. --- src/raymath.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index b4e0336a..dfc43181 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -60,10 +60,12 @@ #endif #ifdef RAYMATH_IMPLEMENTATION - #if defined(_WIN32) - #define RMDEF __declspec(dllexport) extern inline // Provide external definition + #if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED) + #define RMDEF __declspec(dllexport) extern inline // We are building raylib as a Win32 shared library (.dll). + #elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED) + #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) #else - #define RMDEF extern inline + #define RMDEF extern inline // Provide external definition #endif #elif defined RAYMATH_HEADER_ONLY #define RMDEF static inline // Functions may be inlined, no external out-of-line definition