From a85979661f29c19e44e0468ce43d73a4ec7cda10 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 24 Oct 2018 22:28:57 +0200 Subject: [PATCH] REviewed functions definition modifiers --- src/raygui.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index 3cc9680..ec7d44e 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -108,18 +108,23 @@ #include "raylib.h" #endif -// #define RAYGUI_STATIC -#ifdef RAYGUI_STATIC - #define RAYGUIDEF static // Functions just visible to module including this file -#else - #ifdef __cplusplus - #define RAYGUIDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) +#if defined(RAYGUI_IMPLEMENTATION) + #if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED) + #define RAYGUIDEF __declspec(dllexport) extern // We are building raygui as a Win32 shared library (.dll). + #elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED) + #define RAYGUIDEF __declspec(dllimport) // We are using raygui as a Win32 shared library (.dll) #else - #define RAYGUIDEF __declspec(dllexport) extern // Functions visible from other files + #ifdef __cplusplus + #define RAYGUIDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) + #else + #define RAYGUIDEF extern // Functions visible from other files + #endif #endif +#elif defined(RAYGUI_STATIC) + #define RAYGUIDEF static // Functions just visible to module including this file #endif -#include // Required for: atoi() +#include // Required for: atoi() //---------------------------------------------------------------------------------- // Defines and Macros