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 | |
parent | 487795699ace0f6211241f97dfadc7a4e5cdc826 (diff) | |
download | serd-9757f30ad4d9bc1ceb7bb731b19872921f168e59.tar.gz serd-9757f30ad4d9bc1ceb7bb731b19872921f168e59.tar.bz2 serd-9757f30ad4d9bc1ceb7bb731b19872921f168e59.zip |
Allow SERD_API to be defined by the user
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | include/serd/serd.h | 19 |
2 files changed, 13 insertions, 9 deletions
@@ -2,6 +2,7 @@ serd (0.31.0) unstable; urgency=medium * Add Windows path separator support to serd_node_new_file_uri() * Add serd_reader_skip_until_byte() to public API + * Allow SERD_API to be defined by the user * Avoid creating test files in the current directory * Clean up code * Fix crash when trying to read chunks without starting @@ -13,7 +14,7 @@ serd (0.31.0) unstable; urgency=medium * Replace duplicated dox_to_sphinx script with sphinxygen dependency * Test header for warnings more strictly - -- David Robillard <d@drobilla.net> Sun, 11 Dec 2022 16:36:39 +0000 + -- David Robillard <d@drobilla.net> Mon, 19 Dec 2022 23:55:26 +0000 serd (0.30.16) stable; urgency=medium 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__ |