summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-19 18:52:32 -0500
committerDavid Robillard <d@drobilla.net>2022-12-19 18:53:00 -0500
commit3a9b8e38a146dfdbb618d95f6db8fa919fa2e3e6 (patch)
tree697947ff40deb30cb307831bd974934733de5cc2
parent43bca31ffca22a3ff67df8cf10cb1f0fb543a266 (diff)
downloadlilv-3a9b8e38a146dfdbb618d95f6db8fa919fa2e3e6.tar.gz
lilv-3a9b8e38a146dfdbb618d95f6db8fa919fa2e3e6.tar.bz2
lilv-3a9b8e38a146dfdbb618d95f6db8fa919fa2e3e6.zip
Allow LILV_API to be defined by the user
-rw-r--r--NEWS3
-rw-r--r--include/lilv/lilv.h19
2 files changed, 13 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index dc4b47e..41a7664 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
lilv (0.24.21) unstable; urgency=medium
+ * Allow LILV_API to be defined by the user
* Clean up code
* Clean up inconsistent tool command line interfaces
* Convert man pages to mdoc
@@ -9,7 +10,7 @@ lilv (0.24.21) unstable; urgency=medium
* Replace duplicated dox_to_sphinx script with sphinxygen dependency
* Switch to external zix dependency
- -- David Robillard <d@drobilla.net> Sun, 11 Dec 2022 16:32:26 +0000
+ -- David Robillard <d@drobilla.net> Mon, 19 Dec 2022 23:52:50 +0000
lilv (0.24.20) stable; urgency=medium
diff --git a/include/lilv/lilv.h b/include/lilv/lilv.h
index ae2c055..b863a14 100644
--- a/include/lilv/lilv.h
+++ b/include/lilv/lilv.h
@@ -14,14 +14,17 @@
#include <stdint.h>
#include <stdio.h>
-#if defined(_WIN32) && !defined(LILV_STATIC) && defined(LILV_INTERNAL)
-# define LILV_API __declspec(dllexport)
-#elif defined(_WIN32) && !defined(LILV_STATIC)
-# define LILV_API __declspec(dllimport)
-#elif defined(__GNUC__)
-# define LILV_API __attribute__((visibility("default")))
-#else
-# define LILV_API
+// LILV_API must be used to decorate things in the public API
+#ifndef LILV_API
+# if defined(_WIN32) && !defined(LILV_STATIC) && defined(LILV_INTERNAL)
+# define LILV_API __declspec(dllexport)
+# elif defined(_WIN32) && !defined(LILV_STATIC)
+# define LILV_API __declspec(dllimport)
+# elif defined(__GNUC__)
+# define LILV_API __attribute__((visibility("default")))
+# else
+# define LILV_API
+# endif
#endif
#if defined(__GNUC__) && \