From 7b05324a712dabf68545a00b4b91fb6579ab67a1 Mon Sep 17 00:00:00 2001 From: Christophe Chevalier Date: Wed, 9 Dec 2015 15:48:22 +0100 Subject: [PATCH] Only define ZSTDLIB_API when building a Windows DLL --- lib/zstd.h | 10 +++------- lib/zstd_buffered.h | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/zstd.h b/lib/zstd.h index 0795cbb08..b0c841f3a 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -48,14 +48,10 @@ extern "C" { *****************************************************************/ /*! * ZSTD_DLL_EXPORT : -* Enable exporting of functions when building a DLL +* Enable exporting of functions when building a Windows DLL */ -#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) -# if _WIN32 -# define ZSTDLIB_API __declspec(dllexport) -# else -# define ZSTDLIB_API extern -# endif +#if defined(_WIN32) && defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) +# define ZSTDLIB_API __declspec(dllexport) #else # define ZSTDLIB_API #endif diff --git a/lib/zstd_buffered.h b/lib/zstd_buffered.h index fffa70a05..755728b1b 100644 --- a/lib/zstd_buffered.h +++ b/lib/zstd_buffered.h @@ -52,14 +52,10 @@ extern "C" { *****************************************************************/ /*! * ZSTD_DLL_EXPORT : -* Enable exporting of functions when building a DLL +* Enable exporting of functions when building a Windows DLL */ -#if defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) -# if _WIN32 -# define ZSTDLIB_API __declspec(dllexport) -# else -# define ZSTDLIB_API extern -# endif +#if defined(_WIN32) && defined(ZSTD_DLL_EXPORT) && (ZSTD_DLL_EXPORT==1) +# define ZSTDLIB_API __declspec(dllexport) #else # define ZSTDLIB_API #endif