From 7df658ec1b9976e40d3c6abdf70da4560b2edd38 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 12:52:27 +0100 Subject: removed LZ4_DLL_EXPORT=1 (2) --- lib/Makefile | 2 +- lib/lz4.h | 5 ++++- lib/lz4frame.h | 10 ++++------ lib/lz4hc.h | 10 ++++------ programs/Makefile | 2 +- tests/Makefile | 2 +- visual/VS2010/lz4/lz4.vcxproj | 8 ++++---- 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index e3f1c7a..3d251dc 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -44,7 +44,7 @@ BUILD_STATIC:= yes DESTDIR?= PREFIX ?= /usr/local -CPPFLAGS= -DXXH_NAMESPACE=LZ4_ -DLZ4_DLL_EXPORT=1 +CPPFLAGS= -DXXH_NAMESPACE=LZ4_ CFLAGS ?= -O3 CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef \ diff --git a/lib/lz4.h b/lib/lz4.h index fc27c95..f7e2097 100644 --- a/lib/lz4.h +++ b/lib/lz4.h @@ -55,12 +55,15 @@ extern "C" { * LZ4_DLL_EXPORT : * Enable exporting of functions when building a Windows DLL */ -#if defined(_WIN32) && defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) +#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) # define LZ4LIB_API __declspec(dllexport) +#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) +# define LZ4LIB_API __declspec(dllimport) #else # define LZ4LIB_API #endif + /*-************************************ * Version **************************************/ diff --git a/lib/lz4frame.h b/lib/lz4frame.h index 43bc23c..8fc5d17 100644 --- a/lib/lz4frame.h +++ b/lib/lz4frame.h @@ -55,12 +55,10 @@ extern "C" { * LZ4_DLL_EXPORT : * Enable exporting of functions when building a Windows DLL */ -#if defined(_WIN32) -# if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) -# define LZ4FLIB_API __declspec(dllexport) -# else -# define LZ4FLIB_API __declspec(dllimport) -# endif +#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) +# define LZ4FLIB_API __declspec(dllexport) +#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) +# define LZ4FLIB_API __declspec(dllimport) #else # define LZ4FLIB_API #endif diff --git a/lib/lz4hc.h b/lib/lz4hc.h index 4f676aa..563ad98 100644 --- a/lib/lz4hc.h +++ b/lib/lz4hc.h @@ -51,12 +51,10 @@ extern "C" { * LZ4_DLL_EXPORT : * Enable exporting of functions when building a Windows DLL */ -#if defined(_WIN32) -# if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) -# define LZ4HCLIB_API __declspec(dllexport) -# else -# define LZ4HCLIB_API __declspec(dllimport) -# endif +#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) +# define LZ4HCLIB_API __declspec(dllexport) +#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) +# define LZ4HCLIB_API __declspec(dllimport) #else # define LZ4HCLIB_API #endif diff --git a/programs/Makefile b/programs/Makefile index 39672b3..5c2bdcd 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -37,7 +37,7 @@ LZ4DIR := ../lib CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wpointer-arith CFLAGS += $(MOREFLAGS) -CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ -DLZ4_DLL_EXPORT=1 +CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) diff --git a/tests/Makefile b/tests/Makefile index 9415f7b..d5f9133 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -44,7 +44,7 @@ PYTHON?= python3 CFLAGS ?= -O3 # can select custom flags. For example : CFLAGS="-O2 -g" make CFLAGS += -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes CFLAGS += $(MOREFLAGS) -CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ -DLZ4_DLL_EXPORT=1 +CPPFLAGS:= -I$(LZ4DIR) -DXXH_NAMESPACE=LZ4_ FLAGS := $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) diff --git a/visual/VS2010/lz4/lz4.vcxproj b/visual/VS2010/lz4/lz4.vcxproj index a3d8368..a17cdd5 100644 --- a/visual/VS2010/lz4/lz4.vcxproj +++ b/visual/VS2010/lz4/lz4.vcxproj @@ -88,7 +88,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true false @@ -104,7 +104,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true true /analyze:stacksize295252 %(AdditionalOptions) @@ -123,7 +123,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false false @@ -143,7 +143,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false true /analyze:stacksize295252 %(AdditionalOptions) -- cgit v0.12