From fc6f5a92f3be347383d3b34bb8cdfdae33785f6c Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 24 Oct 2018 22:24:59 +0200 Subject: [PATCH] Reviewed functions definition --- src/raymath.h | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 1d5e26f9..42a45ad6 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -46,38 +46,31 @@ //#define RAYMATH_HEADER_ONLY // NOTE: To compile functions as static inline, uncomment this line #ifndef RAYMATH_STANDALONE - #include "raylib.h" // Required for structs: Vector3, Matrix + #include "raylib.h" // Required for structs: Vector3, Matrix #endif -#ifdef __cplusplus - #define RMEXTERN extern "C" // Functions visible from other files (no name mangling of functions in C++) -#else - #define RMEXTERN // Functions visible from other files -#endif - -#if defined RAYMATH_IMPLEMENTATION && defined RAYMATH_HEADER_ONLY +#if defined(RAYMATH_IMPLEMENTATION) && defined(RAYMATH_HEADER_ONLY) #error "Specifying both RAYMATH_IMPLEMENTATION and RAYMATH_HEADER_ONLY is contradictory" #endif -#ifdef RAYMATH_IMPLEMENTATION +#if defined(RAYMATH_IMPLEMENTATION) #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) + #define RMDEF __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) #else #define RMDEF extern inline // Provide external definition #endif -#elif defined RAYMATH_HEADER_ONLY +#elif defined(RAYMATH_HEADER_ONLY) #define RMDEF static inline // Functions may be inlined, no external out-of-line definition #else - #ifdef __TINYC__ + #if defined(__TINYC__) #define RMDEF static inline // plain inline not supported by tinycc (See issue #435) #else #define RMDEF inline // Functions may be inlined or external definition used #endif #endif - //---------------------------------------------------------------------------------- // Defines and Macros //----------------------------------------------------------------------------------