summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormikir <miki_r@volny.cz>2017-10-30 12:44:24 (GMT)
committerGitHub <noreply@github.com>2017-10-30 12:44:24 (GMT)
commit63a7f34fee5e2ecac452aee3731b7390a1eb8328 (patch)
tree6e4601822de974de6eef7a3124aae3bffb288716 /lib
parentdccf8826f1d76efcbdc655e63cc04cdbd1123619 (diff)
downloadlz4-63a7f34fee5e2ecac452aee3731b7390a1eb8328.zip
lz4-63a7f34fee5e2ecac452aee3731b7390a1eb8328.tar.gz
lz4-63a7f34fee5e2ecac452aee3731b7390a1eb8328.tar.bz2
Separated visibility from LZ4LIB_API macro.
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/lz4.h b/lib/lz4.h
index d284d63..509d942 100644
--- a/lib/lz4.h
+++ b/lib/lz4.h
@@ -72,20 +72,24 @@ extern "C" {
/*
* LZ4_DLL_EXPORT :
* Enable exporting of functions when building a Windows DLL
-* LZ4LIB_API :
+* LZ4LIB_VISIBILITY :
* Control library symbols visibility.
*/
+#ifndef LZ4LIB_VISIBILITY
+# if defined(__GNUC__) && (__GNUC__ >= 4)
+# define LZ4LIB_VISIBILITY __attribute__ ((visibility ("default")))
+# else
+# define LZ4LIB_VISIBILITY
+# endif
+#endif
#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1)
-# define LZ4LIB_API __declspec(dllexport)
+# define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY
#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
-# define LZ4LIB_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
-#elif defined(__GNUC__) && (__GNUC__ >= 4)
-# define LZ4LIB_API __attribute__ ((__visibility__ ("default")))
+# define LZ4LIB_API __declspec(dllimport) LZ4LIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
#else
-# define LZ4LIB_API
+# define LZ4LIB_API LZ4LIB_VISIBILITY
#endif
-
/*------ Version ------*/
#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */
#define LZ4_VERSION_MINOR 8 /* for new (non-breaking) interface capabilities */