From a1280406b012a7a5e4f145e9b39bc96efc7cebd6 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Fri, 19 May 2017 18:01:59 -0700 Subject: [PATCH] [libzstd] Allow users to define custom visibility --- lib/common/zstd_errors.h | 10 ++++++---- lib/dictBuilder/zdict.h | 10 ++++++---- lib/zstd.h | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/common/zstd_errors.h b/lib/common/zstd_errors.h index de0fc8984..e067acf6e 100644 --- a/lib/common/zstd_errors.h +++ b/lib/common/zstd_errors.h @@ -19,10 +19,12 @@ extern "C" { /* ===== ZSTDERRORLIB_API : control library symbols visibility ===== */ -#if defined(__GNUC__) && (__GNUC__ >= 4) -# define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default"))) -#else -# define ZSTDERRORLIB_VISIBILITY +#ifndef ZSTDERRORLIB_VISIBILITY +# if defined(__GNUC__) && (__GNUC__ >= 4) +# define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default"))) +# else +# define ZSTDERRORLIB_VISIBILITY +# endif #endif #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) # define ZSTDERRORLIB_API __declspec(dllexport) ZSTDERRORLIB_VISIBILITY diff --git a/lib/dictBuilder/zdict.h b/lib/dictBuilder/zdict.h index 9b53de346..5ef2a3f5b 100644 --- a/lib/dictBuilder/zdict.h +++ b/lib/dictBuilder/zdict.h @@ -20,10 +20,12 @@ extern "C" { /* ===== ZDICTLIB_API : control library symbols visibility ===== */ -#if defined(__GNUC__) && (__GNUC__ >= 4) -# define ZDICTLIB_VISIBILITY __attribute__ ((visibility ("default"))) -#else -# define ZDICTLIB_VISIBILITY +#ifndef ZDICTLIB_VISIBILITY +# if defined(__GNUC__) && (__GNUC__ >= 4) +# define ZDICTLIB_VISIBILITY __attribute__ ((visibility ("default"))) +# else +# define ZDICTLIB_VISIBILITY +# endif #endif #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) # define ZDICTLIB_API __declspec(dllexport) ZDICTLIB_VISIBILITY diff --git a/lib/zstd.h b/lib/zstd.h index d96a535f3..b0aae3f73 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -19,10 +19,12 @@ extern "C" { /* ===== ZSTDLIB_API : control library symbols visibility ===== */ -#if defined(__GNUC__) && (__GNUC__ >= 4) -# define ZSTDLIB_VISIBILITY __attribute__ ((visibility ("default"))) -#else -# define ZSTDLIB_VISIBILITY +#ifndef ZSTDLIB_VISIBILITY +# if defined(__GNUC__) && (__GNUC__ >= 4) +# define ZSTDLIB_VISIBILITY __attribute__ ((visibility ("default"))) +# else +# define ZSTDLIB_VISIBILITY +# endif #endif #if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) # define ZSTDLIB_API __declspec(dllexport) ZSTDLIB_VISIBILITY