aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd/serd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r--include/serd/serd.h19
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__