From 4d2cf9582ba6c5e9cdb29b07427934b2f1e0ef02 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 5 Mar 2010 20:11:04 +0000 Subject: Hide symbols by default and explicitly export API (clean ABI). git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2530 a436a847-0d15-0410-975c-d299462d15a1 --- slv2/types.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'slv2/types.h') diff --git a/slv2/types.h b/slv2/types.h index 2cf01fd..f0f6d58 100644 --- a/slv2/types.h +++ b/slv2/types.h @@ -26,6 +26,24 @@ extern "C" { #include #include +#if defined _WIN32 || defined __CYGWIN__ + #define SLV2_LIB_IMPORT __declspec(dllimport) + #define SLV2_LIB_EXPORT __declspec(dllexport) +#else + #define SLV2_LIB_IMPORT __attribute__ ((visibility("default"))) + #define SLV2_LIB_EXPORT __attribute__ ((visibility("default"))) +#endif + +#ifdef SLV2_SHARED // Building a shared library + #ifdef SLV2_INTERNAL // Building SLV2 (not using it) + #define SLV2_API SLV2_LIB_EXPORT + #else + #define SLV2_API SLV2_LIB_IMPORT + #endif +#else // Building a static library + #define SLV2_API +#endif // SLV2_DLL + #define SLV2_NAMESPACE_LV2 "http://lv2plug.in/ns/lv2core#" #define SLV2_PORT_CLASS_PORT "http://lv2plug.in/ns/lv2core#Port" #define SLV2_PORT_CLASS_INPUT "http://lv2plug.in/ns/lv2core#InputPort" -- cgit v1.2.1