From 8c4670332fa16ab063b7f5bad62246ab7ae43a9c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 19 Dec 2022 18:54:51 -0500 Subject: Allow SUIL_API to be defined by the user --- include/suil/suil.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include/suil') diff --git a/include/suil/suil.h b/include/suil/suil.h index c821641..7f7f3a7 100644 --- a/include/suil/suil.h +++ b/include/suil/suil.h @@ -11,6 +11,7 @@ #include #include +// SUIL_LIB_IMPORT and SUIL_LIB_EXPORT mark the entry points of shared libraries #ifdef _WIN32 # define SUIL_LIB_IMPORT __declspec(dllimport) # define SUIL_LIB_EXPORT __declspec(dllexport) @@ -19,14 +20,15 @@ # define SUIL_LIB_EXPORT __attribute__((visibility("default"))) #endif -#ifndef SUIL_STATIC -# ifdef SUIL_INTERNAL +// SUIL_API exposes symbols in the public API +#ifndef SUIL_API +# ifdef SUIL_STATIC +# define SUIL_API +# elif defined(SUIL_INTERNAL) # define SUIL_API SUIL_LIB_EXPORT # else # define SUIL_API SUIL_LIB_IMPORT # endif -#else -# define SUIL_API #endif #ifdef __cplusplus -- cgit v1.2.1