summaryrefslogtreecommitdiffstats
path: root/lib/lz4frame.h
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2020-08-08 20:21:07 (GMT)
committerGitHub <noreply@github.com>2020-08-08 20:21:07 (GMT)
commit97654d3cd2c61a9aa7f20f117fd0cc69d647a1d6 (patch)
treea2695525086d668b15ec7b14e09a16f5aea954d4 /lib/lz4frame.h
parentcd5d78ebd0a75c68432a1935c8ef9eeb952275c1 (diff)
parentae1372690d3925d893cac44ab6e9a2d6aaff819f (diff)
downloadlz4-97654d3cd2c61a9aa7f20f117fd0cc69d647a1d6.zip
lz4-97654d3cd2c61a9aa7f20f117fd0cc69d647a1d6.tar.gz
lz4-97654d3cd2c61a9aa7f20f117fd0cc69d647a1d6.tar.bz2
Merge pull request #856 from indragiek/indragiek/lz4f-visibility
Add LZ4FLIB_VISIBILITY for controlling library symbol visibility
Diffstat (limited to 'lib/lz4frame.h')
-rw-r--r--lib/lz4frame.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h
index 87b0b2a..77d682b 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 :
+ * LZ4FLIB_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