summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIndragie Karunaratne <i@indragie.com>2020-04-26 21:49:34 (GMT)
committerIndragie Karunaratne <i@indragie.com>2020-04-26 21:51:41 (GMT)
commit8ec5ee30be6dc156f6aa4e2d66eef521f35dc1ee (patch)
tree8219fafc55b105ddc5887e5a19d5bd2741bec103
parentf39b79fb02962a1cd880bbdecb6dffba4f754a11 (diff)
downloadlz4-8ec5ee30be6dc156f6aa4e2d66eef521f35dc1ee.zip
lz4-8ec5ee30be6dc156f6aa4e2d66eef521f35dc1ee.tar.gz
lz4-8ec5ee30be6dc156f6aa4e2d66eef521f35dc1ee.tar.bz2
Add LZ4FLIB_VISIBILITY for controlling library symbol visibility
-rw-r--r--lib/lz4frame.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h
index 391e484..b6ac587 100644
--- a/lib/lz4frame.h
+++ b/lib/lz4frame.h
@@ -66,17 +66,22 @@ extern "C" {
*****************************************************************/
/* LZ4_DLL_EXPORT :
* Enable exporting of functions when building a Windows DLL
- * LZ4FLIB_API :
+ * LZ4LIB_VISIBILITY :
* Control library symbols visibility.
*/
+#ifndef LZ4FLIB_VISIBILITY
+# if defined(__GNUC__) && (__GNUC__ >= 4)
+# define LZ4FLIB_VISIBILITY __attribute__ ((visibility ("default")))
+# else
+# define LZ4FLIB_VISIBILITY
+# endif
+#endif
#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1)
-# define LZ4FLIB_API __declspec(dllexport)
+# define LZ4FLIB_API __declspec(dllexport) LZ4FLIB_VISIBILITY
#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
-# define LZ4FLIB_API __declspec(dllimport)
-#elif defined(__GNUC__) && (__GNUC__ >= 4)
-# define LZ4FLIB_API __attribute__ ((__visibility__ ("default")))
+# define LZ4FLIB_API __declspec(dllimport) LZ4FLIB_VISIBILITY
#else
-# define LZ4FLIB_API
+# define LZ4FLIB_API LZ4FLIB_VISIBILITY
#endif
#ifdef LZ4F_DISABLE_DEPRECATE_WARNINGS