diff options
author | David Robillard <d@drobilla.net> | 2022-12-19 18:55:56 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-12-19 18:55:56 -0500 |
commit | 9757f30ad4d9bc1ceb7bb731b19872921f168e59 (patch) | |
tree | 2a84dfb78aeca6429be5a678c5fa7792de6d3a97 /include/serd/serd.h | |
parent | 487795699ace0f6211241f97dfadc7a4e5cdc826 (diff) | |
download | serd-9757f30ad4d9bc1ceb7bb731b19872921f168e59.tar.gz serd-9757f30ad4d9bc1ceb7bb731b19872921f168e59.tar.bz2 serd-9757f30ad4d9bc1ceb7bb731b19872921f168e59.zip |
Allow SERD_API to be defined by the user
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r-- | include/serd/serd.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h index 42e85f87..c1d1a8b1 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -12,14 +12,17 @@ #include <stdint.h> #include <stdio.h> -#if defined(_WIN32) && !defined(SERD_STATIC) && defined(SERD_INTERNAL) -# define SERD_API __declspec(dllexport) -#elif defined(_WIN32) && !defined(SERD_STATIC) -# define SERD_API __declspec(dllimport) -#elif defined(__GNUC__) -# define SERD_API __attribute__((visibility("default"))) -#else -# define SERD_API +// SERD_API must be used to decorate things in the public API +#ifndef SERD_API +# if defined(_WIN32) && !defined(SERD_STATIC) && defined(SERD_INTERNAL) +# define SERD_API __declspec(dllexport) +# elif defined(_WIN32) && !defined(SERD_STATIC) +# define SERD_API __declspec(dllimport) +# elif defined(__GNUC__) +# define SERD_API __attribute__((visibility("default"))) +# else +# define SERD_API +# endif #endif #ifdef __GNUC__ |