summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-19 18:53:26 -0500
committerDavid Robillard <d@drobilla.net>2022-12-19 18:54:18 -0500
commitb9818bc8381dc34cb8b1a293e460d37645a3d3b1 (patch)
treee8f1c2f62e56f6107f71904381bf0893ddb3ba53
parent64c1306c85964417849376e28436086face489f8 (diff)
downloadsord-b9818bc8381dc34cb8b1a293e460d37645a3d3b1.tar.gz
sord-b9818bc8381dc34cb8b1a293e460d37645a3d3b1.tar.bz2
sord-b9818bc8381dc34cb8b1a293e460d37645a3d3b1.zip
Allow SORD_API to be defined by the user
-rw-r--r--NEWS3
-rw-r--r--include/sord/sord.h19
2 files changed, 13 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index 4faa492..b399811 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,12 @@
sord (0.16.15) unstable; urgency=medium
+ * Allow SORD_API to be defined by the user
* Fix command line help interface of sord_validate
* Fix dependencies in pkg-config file
* Override pkg-config dependency within meson
* Port sord_validate to pcre2
- -- David Robillard <d@drobilla.net> Tue, 29 Nov 2022 19:50:26 +0000
+ -- David Robillard <d@drobilla.net> Mon, 19 Dec 2022 23:53:40 +0000
sord (0.16.14) stable; urgency=medium
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 <stddef.h>
#include <stdint.h>
-#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