From b9818bc8381dc34cb8b1a293e460d37645a3d3b1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 19 Dec 2022 18:53:26 -0500 Subject: Allow SORD_API to be defined by the user --- include/sord/sord.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'include/sord/sord.h') diff --git a/include/sord/sord.h b/include/sord/sord.h index af06c81..08ab46f 100644 --- a/include/sord/sord.h +++ b/include/sord/sord.h @@ -14,14 +14,17 @@ #include #include -#if defined(_WIN32) && !defined(SORD_STATIC) && defined(SORD_INTERNAL) -# define SORD_API __declspec(dllexport) -#elif defined(_WIN32) && !defined(SORD_STATIC) -# define SORD_API __declspec(dllimport) -#elif defined(__GNUC__) -# define SORD_API __attribute__((visibility("default"))) -#else -# define SORD_API +// SORD_API must be used to decorate things in the public API +#ifndef SORD_API +# if defined(_WIN32) && !defined(SORD_STATIC) && defined(SORD_INTERNAL) +# define SORD_API __declspec(dllexport) +# elif defined(_WIN32) && !defined(SORD_STATIC) +# define SORD_API __declspec(dllimport) +# elif defined(__GNUC__) +# define SORD_API __attribute__((visibility("default"))) +# else +# define SORD_API +# endif #endif #ifdef __cplusplus -- cgit v1.2.1