From fe5148417feea3d984ef792fb420f1329dbe8542 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 11:45:55 +0100 Subject: introduced LZ4_COMPILED_AS_DLL --- lib/lz4frame.c | 7 +++++++ tests/fullbench.c | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/lz4frame.c b/lib/lz4frame.c index a946f29..93657aa 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -67,6 +67,12 @@ You can contact the author at : /*-************************************ +* Common Utils +**************************************/ +#define LZ4_STATIC_ASSERT(c) { enum { LZ4_static_assert = 1/(int)(!!(c)) }; } /* use only *after* variable declarations */ + + +/*-************************************ * Basic Types **************************************/ #if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) @@ -378,6 +384,7 @@ size_t LZ4F_compressBegin(LZ4F_cctx* cctxPtr, void* dstBuffer, size_t dstMaxSize BYTE* headerStart; size_t requiredBuffSize; + LZ4_STATIC_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t)); /* A compilation error here means sizeof(ptrdiff_t) is not large enough */ if (dstMaxSize < maxFHSize) return err0r(LZ4F_ERROR_dstMaxSize_tooSmall); if (cctxPtr->cStage != 0) return err0r(LZ4F_ERROR_GENERIC); memset(&prefNull, 0, sizeof(prefNull)); diff --git a/tests/fullbench.c b/tests/fullbench.c index 67442b2..baebb14 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -294,6 +294,7 @@ static int local_LZ4_compress_limitedOutput_continue(const char* in, char* out, return LZ4_compress_limitedOutput_continue(&LZ4_stream, in, out, inSize, LZ4_compressBound(inSize)-1); } +#ifndef LZ4_COMPILED_AS_DLL /* declare hidden function */ int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_stream, const char* source, char* dest, int inputSize); @@ -301,6 +302,7 @@ static int local_LZ4_compress_forceDict(const char* in, char* out, int inSize) { return LZ4_compress_forceExtDict(&LZ4_stream, in, out, inSize); } +#endif /* HC compression functions */ @@ -364,6 +366,7 @@ static int local_LZ4_decompress_safe_usingDict(const char* in, char* out, int in return outSize; } +#ifndef LZ4_COMPILED_AS_DLL extern int LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize, const char* dict, int dictSize); static int local_LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize) @@ -372,6 +375,7 @@ static int local_LZ4_decompress_safe_forceExtDict(const char* in, char* out, int LZ4_decompress_safe_forceExtDict(in, out, inSize, outSize, out - 65536, 65536); return outSize; } +#endif static int local_LZ4_decompress_safe_partial(const char* in, char* out, int inSize, int outSize) { @@ -521,8 +525,10 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles) case 13: compressionFunction = local_LZ4_compressHC_limitedOutput_withStateHC; compressorName = "LZ4_compressHC_limitedOutput_withStateHC"; break; case 14: compressionFunction = local_LZ4_compressHC_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_continue"; break; case 15: compressionFunction = local_LZ4_compressHC_limitedOutput_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_limitedOutput_continue"; break; - case 20: compressionFunction = local_LZ4_compress_forceDict; initFunction = local_LZ4_resetDictT; compressorName = "LZ4_compress_forceDict"; break; - case 30: compressionFunction = local_LZ4F_compressFrame; compressorName = "LZ4F_compressFrame"; +#ifndef LZ4_COMPILED_AS_DLL + case 20: compressionFunction = local_LZ4_compress_forceDict; initFunction = local_LZ4_resetDictT; compressorName = "LZ4_compress_forceDict"; break; +#endif + case 30: compressionFunction = local_LZ4F_compressFrame; compressorName = "LZ4F_compressFrame"; chunkP[0].origSize = (int)benchedSize; nbChunks=1; break; case 40: compressionFunction = local_LZ4_saveDict; compressorName = "LZ4_saveDict"; @@ -614,8 +620,10 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles) case 4: decompressionFunction = LZ4_decompress_safe; dName = "LZ4_decompress_safe"; break; case 6: decompressionFunction = local_LZ4_decompress_safe_usingDict; dName = "LZ4_decompress_safe_usingDict"; break; case 7: decompressionFunction = local_LZ4_decompress_safe_partial; dName = "LZ4_decompress_safe_partial"; break; - case 8: decompressionFunction = local_LZ4_decompress_safe_forceExtDict; dName = "LZ4_decompress_safe_forceExtDict"; break; - case 9: decompressionFunction = local_LZ4F_decompress; dName = "LZ4F_decompress"; +#ifndef LZ4_COMPILED_AS_DLL + case 8: decompressionFunction = local_LZ4_decompress_safe_forceExtDict; dName = "LZ4_decompress_safe_forceExtDict"; break; +#endif + case 9: decompressionFunction = local_LZ4F_decompress; dName = "LZ4F_decompress"; errorCode = LZ4F_compressFrame(compressed_buff, compressedBuffSize, orig_buff, benchedSize, NULL); if (LZ4F_isError(errorCode)) { DISPLAY("Error while preparing compressed frame\n"); -- cgit v0.12 From bde0d340b4e8056bd04ffe1102ae5a84e05644b4 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 11:55:34 +0100 Subject: added fullbench-dll.vcxproj --- visual/VS2010/fullbench-dll/fullbench-dll.vcxproj | 166 +++++++++++++++++++++ visual/VS2010/liblz4-dll/liblz4-dll.rc | 51 +++++++ visual/VS2010/liblz4-dll/liblz4-dll.vcxproj | 171 ++++++++++++++++++++++ visual/VS2010/lz4-dll/lz4-dll.rc | 51 ------- visual/VS2010/lz4-dll/lz4-dll.vcxproj | 171 ---------------------- visual/VS2010/lz4.sln | 12 +- 6 files changed, 399 insertions(+), 223 deletions(-) create mode 100644 visual/VS2010/fullbench-dll/fullbench-dll.vcxproj create mode 100644 visual/VS2010/liblz4-dll/liblz4-dll.rc create mode 100644 visual/VS2010/liblz4-dll/liblz4-dll.vcxproj delete mode 100644 visual/VS2010/lz4-dll/lz4-dll.rc delete mode 100644 visual/VS2010/lz4-dll/lz4-dll.vcxproj diff --git a/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj new file mode 100644 index 0000000..cf3ed15 --- /dev/null +++ b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj @@ -0,0 +1,166 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {13992FD2-077E-4954-B065-A428198201A9} + Win32Proj + lz4dlltest + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + true + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + false + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + false + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + + NotUsing + Level3 + Disabled + LZ4_USE_DLL;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) + liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + Disabled + LZ4_USE_DLL;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) + liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + LZ4_USE_DLL;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) + liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + NotUsing + MaxSpeed + true + true + LZ4_USE_DLL;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) + liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + \ No newline at end of file diff --git a/visual/VS2010/liblz4-dll/liblz4-dll.rc b/visual/VS2010/liblz4-dll/liblz4-dll.rc new file mode 100644 index 0000000..b907a2d --- /dev/null +++ b/visual/VS2010/liblz4-dll/liblz4-dll.rc @@ -0,0 +1,51 @@ +// Microsoft Visual C++ generated resource script. +// + +#include "lz4.h" /* LZ4_VERSION_STRING */ +#define APSTUDIO_READONLY_SYMBOLS +#include "verrsrc.h" +#undef APSTUDIO_READONLY_SYMBOLS + + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 + PRODUCTVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Yann Collet" + VALUE "FileDescription", "Extremely fast compression" + VALUE "FileVersion", LZ4_VERSION_STRING + VALUE "InternalName", "liblz4.dll" + VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" + VALUE "OriginalFilename", "liblz4.dll" + VALUE "ProductName", "LZ4" + VALUE "ProductVersion", LZ4_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1200 + END +END + +#endif diff --git a/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj b/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj new file mode 100644 index 0000000..3f919ca --- /dev/null +++ b/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {9800039D-4AAA-43A4-BB78-FEF6F4836927} + Win32Proj + liblz4-dll + $(SolutionDir)bin\$(Platform)_$(Configuration)\ + $(SolutionDir)bin\obj\$(RootNamespace)_$(Platform)_$(Configuration)\ + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + liblz4_x86 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + true + liblz4_x64 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + liblz4_x86 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + false + liblz4_x64 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + + + + Level4 + Disabled + WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + true + false + + + true + + + + + + + Level4 + Disabled + WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + true + true + /analyze:stacksize295252 %(AdditionalOptions) + + + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + false + false + + + true + true + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + false + true + /analyze:stacksize295252 %(AdditionalOptions) + + + true + true + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/visual/VS2010/lz4-dll/lz4-dll.rc b/visual/VS2010/lz4-dll/lz4-dll.rc deleted file mode 100644 index 4c4ba1c..0000000 --- a/visual/VS2010/lz4-dll/lz4-dll.rc +++ /dev/null @@ -1,51 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// - -#include "lz4.h" /* LZ4_VERSION_STRING */ -#define APSTUDIO_READONLY_SYMBOLS -#include "verrsrc.h" -#undef APSTUDIO_READONLY_SYMBOLS - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 - PRODUCTVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS_NT_WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "Yann Collet" - VALUE "FileDescription", "Fast and efficient compression algorithm" - VALUE "FileVersion", LZ4_VERSION_STRING - VALUE "InternalName", "liblz4.dll" - VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" - VALUE "OriginalFilename", "liblz4.dll" - VALUE "ProductName", "LZ4" - VALUE "ProductVersion", LZ4_VERSION_STRING - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 1200 - END -END - -#endif diff --git a/visual/VS2010/lz4-dll/lz4-dll.vcxproj b/visual/VS2010/lz4-dll/lz4-dll.vcxproj deleted file mode 100644 index cb44957..0000000 --- a/visual/VS2010/lz4-dll/lz4-dll.vcxproj +++ /dev/null @@ -1,171 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {9800039D-4AAA-43A4-BB78-FEF6F4836927} - Win32Proj - lz4-dll - $(SolutionDir)bin\$(Platform)_$(Configuration)\ - $(SolutionDir)bin\obj\$(RootNamespace)_$(Platform)_$(Configuration)\ - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - liblz4_x86 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - - - true - liblz4_x64 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - true - - - false - liblz4_x86 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - - - false - liblz4_x64 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - true - - - - - - Level4 - Disabled - WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - true - false - - - true - - - - - - - Level4 - Disabled - WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - true - true - /analyze:stacksize295252 %(AdditionalOptions) - - - true - - - - - Level4 - - - MaxSpeed - true - true - WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - false - false - - - true - true - true - - - - - Level4 - - - MaxSpeed - true - true - WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - false - true - /analyze:stacksize295252 %(AdditionalOptions) - - - true - true - true - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/visual/VS2010/lz4.sln b/visual/VS2010/lz4.sln index c9872a1..59be8fe 100644 --- a/visual/VS2010/lz4.sln +++ b/visual/VS2010/lz4.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Express 2012 for Windows Desktop Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lz4", "lz4\lz4.vcxproj", "{E30329AC-0057-4FE0-8FDA-7F650D398C4C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lz4-dll", "lz4-dll\lz4-dll.vcxproj", "{9800039D-4AAA-43A4-BB78-FEF6F4836927}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblz4-dll", "liblz4-dll\liblz4-dll.vcxproj", "{9800039D-4AAA-43A4-BB78-FEF6F4836927}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblz4", "liblz4\liblz4.vcxproj", "{9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}" EndProject @@ -15,6 +15,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "frametest", "frametest\fram EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datagen", "datagen\datagen.vcxproj", "{D745AE2F-596A-403A-9B91-81A8C6779243}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fullbench-dll", "fullbench-dll\fullbench-dll.vcxproj", "{13992FD2-077E-4954-B065-A428198201A9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -79,6 +81,14 @@ Global {D745AE2F-596A-403A-9B91-81A8C6779243}.Release|Win32.Build.0 = Release|Win32 {D745AE2F-596A-403A-9B91-81A8C6779243}.Release|x64.ActiveCfg = Release|x64 {D745AE2F-596A-403A-9B91-81A8C6779243}.Release|x64.Build.0 = Release|x64 + {13992FD2-077E-4954-B065-A428198201A9}.Debug|Win32.ActiveCfg = Debug|Win32 + {13992FD2-077E-4954-B065-A428198201A9}.Debug|Win32.Build.0 = Debug|Win32 + {13992FD2-077E-4954-B065-A428198201A9}.Debug|x64.ActiveCfg = Debug|x64 + {13992FD2-077E-4954-B065-A428198201A9}.Debug|x64.Build.0 = Debug|x64 + {13992FD2-077E-4954-B065-A428198201A9}.Release|Win32.ActiveCfg = Release|Win32 + {13992FD2-077E-4954-B065-A428198201A9}.Release|Win32.Build.0 = Release|Win32 + {13992FD2-077E-4954-B065-A428198201A9}.Release|x64.ActiveCfg = Release|x64 + {13992FD2-077E-4954-B065-A428198201A9}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v0.12 From 4a6e7327c7be56abdd3c5a32d8a69213f46956d3 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 12:36:49 +0100 Subject: removed LZ4_DLL_EXPORT=1 --- visual/VS2010/datagen/datagen.vcxproj | 8 +- visual/VS2010/frametest/frametest.vcxproj | 8 +- visual/VS2010/fullbench-dll/fullbench-dll.vcxproj | 102 ++++++++++++---------- visual/VS2010/fullbench/fullbench.vcxproj | 8 +- visual/VS2010/fuzzer/fuzzer.vcxproj | 8 +- visual/VS2010/liblz4-dll/liblz4-dll.vcxproj | 8 +- 6 files changed, 75 insertions(+), 67 deletions(-) diff --git a/visual/VS2010/datagen/datagen.vcxproj b/visual/VS2010/datagen/datagen.vcxproj index 2906084..aaf81ad 100644 --- a/visual/VS2010/datagen/datagen.vcxproj +++ b/visual/VS2010/datagen/datagen.vcxproj @@ -88,7 +88,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true false @@ -103,7 +103,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true true /analyze:stacksize295252 %(AdditionalOptions) @@ -121,7 +121,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false false @@ -140,7 +140,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false true /analyze:stacksize295252 %(AdditionalOptions) diff --git a/visual/VS2010/frametest/frametest.vcxproj b/visual/VS2010/frametest/frametest.vcxproj index 9de7c2a..363c5ae 100644 --- a/visual/VS2010/frametest/frametest.vcxproj +++ b/visual/VS2010/frametest/frametest.vcxproj @@ -88,7 +88,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true false @@ -103,7 +103,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true true /analyze:stacksize295252 %(AdditionalOptions) @@ -121,7 +121,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false false @@ -140,7 +140,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false true /analyze:stacksize295252 %(AdditionalOptions) diff --git a/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj index cf3ed15..5cd2a44 100644 --- a/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj +++ b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj @@ -5,14 +5,14 @@ Debug Win32 - - Release - Win32 - Debug x64 + + Release + Win32 + Release x64 @@ -21,51 +21,50 @@ {13992FD2-077E-4954-B065-A428198201A9} Win32Proj - lz4dlltest - 8.1 + fullbench-dll + $(SolutionDir)bin\$(Platform)_$(Configuration)\ + $(SolutionDir)bin\obj\$(RootNamespace)_$(Platform)_$(Configuration)\ Application true + Unicode v140 + + + Application + true Unicode + v140 Application false - v140 true Unicode - - - Application - true v140 - Unicode Application false - v140 true Unicode + v140 - - - + - + - + @@ -76,6 +75,7 @@ true $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true false @@ -84,82 +84,90 @@ false $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true - NotUsing - Level3 + + + Level4 Disabled - LZ4_USE_DLL;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true + WIN32;_DEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + true + false Console true - D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) - liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - NotUsing - Level3 + + + Level4 Disabled - LZ4_USE_DLL;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true + WIN32;_DEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + true + true + /analyze:stacksize295252 %(AdditionalOptions) Console true - D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) - liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - Level3 - NotUsing + Level4 + + MaxSpeed true true - LZ4_USE_DLL;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true + WIN32;NDEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + false + false Console + true true true - true - D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) - liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - Level3 - NotUsing + Level4 + + MaxSpeed true true - LZ4_USE_DLL;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true + WIN32;NDEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + false + true + /analyze:stacksize295252 %(AdditionalOptions) Console + true true true - true - D:\GitHub\lz4\visual\VS2010\bin\x64_Release;%(AdditionalLibraryDirectories) - liblz4_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)bin\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories) + lz4_x64.lib;%(AdditionalDependencies) - - - + + + + + + diff --git a/visual/VS2010/fullbench/fullbench.vcxproj b/visual/VS2010/fullbench/fullbench.vcxproj index 157ba3f..8d0a623 100644 --- a/visual/VS2010/fullbench/fullbench.vcxproj +++ b/visual/VS2010/fullbench/fullbench.vcxproj @@ -88,7 +88,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true false @@ -103,7 +103,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true true /analyze:stacksize295252 %(AdditionalOptions) @@ -121,7 +121,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false false @@ -140,7 +140,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false true /analyze:stacksize295252 %(AdditionalOptions) diff --git a/visual/VS2010/fuzzer/fuzzer.vcxproj b/visual/VS2010/fuzzer/fuzzer.vcxproj index 3779212..6672aaa 100644 --- a/visual/VS2010/fuzzer/fuzzer.vcxproj +++ b/visual/VS2010/fuzzer/fuzzer.vcxproj @@ -88,7 +88,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true false @@ -103,7 +103,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true true /analyze:stacksize295252 %(AdditionalOptions) @@ -121,7 +121,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false false @@ -140,7 +140,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) false true /analyze:stacksize295252 %(AdditionalOptions) diff --git a/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj b/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj index 3f919ca..0d029c3 100644 --- a/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj +++ b/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj @@ -66,23 +66,23 @@ true - liblz4_x86 + lz4_x86 $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); true - liblz4_x64 + lz4_x64 $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); true false - liblz4_x86 + lz4_x86 $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); false - liblz4_x64 + lz4_x64 $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); true -- cgit v0.12 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 From ef2fdfe3dc6efe317100ffb664e9064b71997daf Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 13:08:15 +0100 Subject: rename liblz4-dll to lz4-dll --- visual/VS2010/liblz4-dll/liblz4-dll.rc | 51 --------- visual/VS2010/liblz4-dll/liblz4-dll.vcxproj | 171 ---------------------------- visual/VS2010/liblz4-dll/lz4-dll.rc | 51 +++++++++ visual/VS2010/liblz4-dll/lz4-dll.vcxproj | 171 ++++++++++++++++++++++++++++ visual/VS2010/lz4.sln | 2 +- 5 files changed, 223 insertions(+), 223 deletions(-) delete mode 100644 visual/VS2010/liblz4-dll/liblz4-dll.rc delete mode 100644 visual/VS2010/liblz4-dll/liblz4-dll.vcxproj create mode 100644 visual/VS2010/liblz4-dll/lz4-dll.rc create mode 100644 visual/VS2010/liblz4-dll/lz4-dll.vcxproj diff --git a/visual/VS2010/liblz4-dll/liblz4-dll.rc b/visual/VS2010/liblz4-dll/liblz4-dll.rc deleted file mode 100644 index b907a2d..0000000 --- a/visual/VS2010/liblz4-dll/liblz4-dll.rc +++ /dev/null @@ -1,51 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// - -#include "lz4.h" /* LZ4_VERSION_STRING */ -#define APSTUDIO_READONLY_SYMBOLS -#include "verrsrc.h" -#undef APSTUDIO_READONLY_SYMBOLS - - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 - PRODUCTVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS_NT_WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "Yann Collet" - VALUE "FileDescription", "Extremely fast compression" - VALUE "FileVersion", LZ4_VERSION_STRING - VALUE "InternalName", "liblz4.dll" - VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" - VALUE "OriginalFilename", "liblz4.dll" - VALUE "ProductName", "LZ4" - VALUE "ProductVersion", LZ4_VERSION_STRING - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 1200 - END -END - -#endif diff --git a/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj b/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj deleted file mode 100644 index 0d029c3..0000000 --- a/visual/VS2010/liblz4-dll/liblz4-dll.vcxproj +++ /dev/null @@ -1,171 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {9800039D-4AAA-43A4-BB78-FEF6F4836927} - Win32Proj - liblz4-dll - $(SolutionDir)bin\$(Platform)_$(Configuration)\ - $(SolutionDir)bin\obj\$(RootNamespace)_$(Platform)_$(Configuration)\ - - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - DynamicLibrary - false - true - Unicode - - - - - - - - - - - - - - - - - - - true - lz4_x86 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - - - true - lz4_x64 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - true - - - false - lz4_x86 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - - - false - lz4_x64 - $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); - true - - - - - - Level4 - Disabled - WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - true - false - - - true - - - - - - - Level4 - Disabled - WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - true - true - /analyze:stacksize295252 %(AdditionalOptions) - - - true - - - - - Level4 - - - MaxSpeed - true - true - WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - false - false - - - true - true - true - - - - - Level4 - - - MaxSpeed - true - true - WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) - false - true - /analyze:stacksize295252 %(AdditionalOptions) - - - true - true - true - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/visual/VS2010/liblz4-dll/lz4-dll.rc b/visual/VS2010/liblz4-dll/lz4-dll.rc new file mode 100644 index 0000000..b907a2d --- /dev/null +++ b/visual/VS2010/liblz4-dll/lz4-dll.rc @@ -0,0 +1,51 @@ +// Microsoft Visual C++ generated resource script. +// + +#include "lz4.h" /* LZ4_VERSION_STRING */ +#define APSTUDIO_READONLY_SYMBOLS +#include "verrsrc.h" +#undef APSTUDIO_READONLY_SYMBOLS + + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 + PRODUCTVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Yann Collet" + VALUE "FileDescription", "Extremely fast compression" + VALUE "FileVersion", LZ4_VERSION_STRING + VALUE "InternalName", "liblz4.dll" + VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" + VALUE "OriginalFilename", "liblz4.dll" + VALUE "ProductName", "LZ4" + VALUE "ProductVersion", LZ4_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1200 + END +END + +#endif diff --git a/visual/VS2010/liblz4-dll/lz4-dll.vcxproj b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj new file mode 100644 index 0000000..5720334 --- /dev/null +++ b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {9800039D-4AAA-43A4-BB78-FEF6F4836927} + Win32Proj + lz4-dll + $(SolutionDir)bin\$(Platform)_$(Configuration)\ + $(SolutionDir)bin\obj\$(RootNamespace)_$(Platform)_$(Configuration)\ + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + lz4_x86 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + true + lz4_x64 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + false + lz4_x86 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + + + false + lz4_x64 + $(IncludePath);$(UniversalCRT_IncludePath);$(SolutionDir)..\..\lib;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath); + true + + + + + + Level4 + Disabled + WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + true + false + + + true + + + + + + + Level4 + Disabled + WIN32;_DEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + true + true + /analyze:stacksize295252 %(AdditionalOptions) + + + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + false + false + + + true + true + true + + + + + Level4 + + + MaxSpeed + true + true + WIN32;NDEBUG;LZ4_DLL_EXPORT=1;%(PreprocessorDefinitions) + false + true + /analyze:stacksize295252 %(AdditionalOptions) + + + true + true + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/visual/VS2010/lz4.sln b/visual/VS2010/lz4.sln index 59be8fe..c88461e 100644 --- a/visual/VS2010/lz4.sln +++ b/visual/VS2010/lz4.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Express 2012 for Windows Desktop Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lz4", "lz4\lz4.vcxproj", "{E30329AC-0057-4FE0-8FDA-7F650D398C4C}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblz4-dll", "liblz4-dll\liblz4-dll.vcxproj", "{9800039D-4AAA-43A4-BB78-FEF6F4836927}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblz4-dll", "liblz4-dll\lz4-dll.vcxproj", "{9800039D-4AAA-43A4-BB78-FEF6F4836927}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblz4", "liblz4\liblz4.vcxproj", "{9092C5CC-3E71-41B3-BF68-4A7BDD8A5476}" EndProject -- cgit v0.12 From 325babddf075cf980f05acdb4ebce81b5c76e080 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 13:10:09 +0100 Subject: added lz4.rc --- visual/VS2010/lz4/lz4.rc | 51 +++++++++++++++++++++++++++++++++++++++++++ visual/VS2010/lz4/lz4.vcxproj | 3 +++ 2 files changed, 54 insertions(+) create mode 100644 visual/VS2010/lz4/lz4.rc diff --git a/visual/VS2010/lz4/lz4.rc b/visual/VS2010/lz4/lz4.rc new file mode 100644 index 0000000..c593edf --- /dev/null +++ b/visual/VS2010/lz4/lz4.rc @@ -0,0 +1,51 @@ +// Microsoft Visual C++ generated resource script. +// + +#include "lz4.h" /* LZ4_VERSION_STRING */ +#define APSTUDIO_READONLY_SYMBOLS +#include "verrsrc.h" +#undef APSTUDIO_READONLY_SYMBOLS + + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 + PRODUCTVERSION LZ4_VERSION_MAJOR,LZ4_VERSION_MINOR,LZ4_VERSION_RELEASE,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Yann Collet" + VALUE "FileDescription", "Extremely fast compression" + VALUE "FileVersion", LZ4_VERSION_STRING + VALUE "InternalName", "lz4.exe" + VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" + VALUE "OriginalFilename", "lz4.exe" + VALUE "ProductName", "LZ4" + VALUE "ProductVersion", LZ4_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1200 + END +END + +#endif diff --git a/visual/VS2010/lz4/lz4.vcxproj b/visual/VS2010/lz4/lz4.vcxproj index a17cdd5..295a94b 100644 --- a/visual/VS2010/lz4/lz4.vcxproj +++ b/visual/VS2010/lz4/lz4.vcxproj @@ -176,6 +176,9 @@ + + + -- cgit v0.12 From dd14dca15cd595f28e820d9a5ab31e151bd9aa76 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 13:19:08 +0100 Subject: LZ4_DLL_IMPORT --- tests/fullbench.c | 8 ++++---- visual/VS2010/fullbench-dll/fullbench-dll.vcxproj | 14 ++++++++++---- visual/VS2010/liblz4-dll/lz4-dll.rc | 4 ++-- visual/VS2010/liblz4-dll/lz4-dll.vcxproj | 3 +++ 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/tests/fullbench.c b/tests/fullbench.c index baebb14..975cf8a 100644 --- a/tests/fullbench.c +++ b/tests/fullbench.c @@ -294,7 +294,7 @@ static int local_LZ4_compress_limitedOutput_continue(const char* in, char* out, return LZ4_compress_limitedOutput_continue(&LZ4_stream, in, out, inSize, LZ4_compressBound(inSize)-1); } -#ifndef LZ4_COMPILED_AS_DLL +#ifndef LZ4_DLL_IMPORT /* declare hidden function */ int LZ4_compress_forceExtDict (LZ4_stream_t* LZ4_stream, const char* source, char* dest, int inputSize); @@ -366,7 +366,7 @@ static int local_LZ4_decompress_safe_usingDict(const char* in, char* out, int in return outSize; } -#ifndef LZ4_COMPILED_AS_DLL +#ifndef LZ4_DLL_IMPORT extern int LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize, const char* dict, int dictSize); static int local_LZ4_decompress_safe_forceExtDict(const char* in, char* out, int inSize, int outSize) @@ -525,7 +525,7 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles) case 13: compressionFunction = local_LZ4_compressHC_limitedOutput_withStateHC; compressorName = "LZ4_compressHC_limitedOutput_withStateHC"; break; case 14: compressionFunction = local_LZ4_compressHC_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_continue"; break; case 15: compressionFunction = local_LZ4_compressHC_limitedOutput_continue; initFunction = local_LZ4_resetStreamHC; compressorName = "LZ4_compressHC_limitedOutput_continue"; break; -#ifndef LZ4_COMPILED_AS_DLL +#ifndef LZ4_DLL_IMPORT case 20: compressionFunction = local_LZ4_compress_forceDict; initFunction = local_LZ4_resetDictT; compressorName = "LZ4_compress_forceDict"; break; #endif case 30: compressionFunction = local_LZ4F_compressFrame; compressorName = "LZ4F_compressFrame"; @@ -620,7 +620,7 @@ int fullSpeedBench(const char** fileNamesTable, int nbFiles) case 4: decompressionFunction = LZ4_decompress_safe; dName = "LZ4_decompress_safe"; break; case 6: decompressionFunction = local_LZ4_decompress_safe_usingDict; dName = "LZ4_decompress_safe_usingDict"; break; case 7: decompressionFunction = local_LZ4_decompress_safe_partial; dName = "LZ4_decompress_safe_partial"; break; -#ifndef LZ4_COMPILED_AS_DLL +#ifndef LZ4_DLL_IMPORT case 8: decompressionFunction = local_LZ4_decompress_safe_forceExtDict; dName = "LZ4_decompress_safe_forceExtDict"; break; #endif case 9: decompressionFunction = local_LZ4F_decompress; dName = "LZ4F_decompress"; diff --git a/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj index 5cd2a44..a3ce046 100644 --- a/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj +++ b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj @@ -92,13 +92,15 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;LZ4_DLL_IMPORT=1;%(PreprocessorDefinitions) true false Console true + $(SolutionDir)bin\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories) + lz4_x86.lib;%(AdditionalDependencies) @@ -107,7 +109,7 @@ Level4 Disabled - WIN32;_DEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;LZ4_DLL_IMPORT=1;%(PreprocessorDefinitions) true true /analyze:stacksize295252 %(AdditionalOptions) @@ -115,6 +117,8 @@ Console true + $(SolutionDir)bin\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories) + lz4_x64.lib;%(AdditionalDependencies) @@ -125,7 +129,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;LZ4_DLL_IMPORT=1;%(PreprocessorDefinitions) false false @@ -134,6 +138,8 @@ true true true + $(SolutionDir)bin\$(Platform)_$(Configuration);%(AdditionalLibraryDirectories) + lz4_x86.lib;%(AdditionalDependencies) @@ -144,7 +150,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;LZ4_COMPILED_AS_DLL=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;LZ4_DLL_IMPORT=1;%(PreprocessorDefinitions) false true /analyze:stacksize295252 %(AdditionalOptions) diff --git a/visual/VS2010/liblz4-dll/lz4-dll.rc b/visual/VS2010/liblz4-dll/lz4-dll.rc index b907a2d..b1871fe 100644 --- a/visual/VS2010/liblz4-dll/lz4-dll.rc +++ b/visual/VS2010/liblz4-dll/lz4-dll.rc @@ -35,9 +35,9 @@ BEGIN VALUE "CompanyName", "Yann Collet" VALUE "FileDescription", "Extremely fast compression" VALUE "FileVersion", LZ4_VERSION_STRING - VALUE "InternalName", "liblz4.dll" + VALUE "InternalName", "lz4.dll" VALUE "LegalCopyright", "Copyright (C) 2013-2016, Yann Collet" - VALUE "OriginalFilename", "liblz4.dll" + VALUE "OriginalFilename", "lz4.dll" VALUE "ProductName", "LZ4" VALUE "ProductVersion", LZ4_VERSION_STRING END diff --git a/visual/VS2010/liblz4-dll/lz4-dll.vcxproj b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj index 5720334..f823572 100644 --- a/visual/VS2010/liblz4-dll/lz4-dll.vcxproj +++ b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj @@ -165,6 +165,9 @@ + + + -- cgit v0.12 From 9e7fe106221d90c4ff9414374d6ae149d302526b Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 13:28:50 +0100 Subject: removed --- visual/VS2010/fullbench-dll/fullbench-dll.vcxproj | 4 ---- visual/VS2010/liblz4-dll/lz4-dll.vcxproj | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj index a3ce046..c25e41c 100644 --- a/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj +++ b/visual/VS2010/fullbench-dll/fullbench-dll.vcxproj @@ -30,27 +30,23 @@ Application true Unicode - v140 Application true Unicode - v140 Application false true Unicode - v140 Application false true Unicode - v140 diff --git a/visual/VS2010/liblz4-dll/lz4-dll.vcxproj b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj index f823572..eef1b2e 100644 --- a/visual/VS2010/liblz4-dll/lz4-dll.vcxproj +++ b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj @@ -21,7 +21,7 @@ {9800039D-4AAA-43A4-BB78-FEF6F4836927} Win32Proj - lz4-dll + liblz4-dll $(SolutionDir)bin\$(Platform)_$(Configuration)\ $(SolutionDir)bin\obj\$(RootNamespace)_$(Platform)_$(Configuration)\ -- cgit v0.12 From c794829a203f21f375be19076cf439825a755c1a Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 13:34:35 +0100 Subject: update .gitignore --- .gitignore | 2 -- visual/.gitignore | 18 ++++++------------ visual/VS2010/liblz4-dll/lz4-dll.vcxproj | 1 + visual/VS2010/lz4.sln | 1 - 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index cd47ddd..6bcbb3e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,6 @@ lz4 # IDE / editors files -*.suo -*.user .clang_complete _codelite/ _codelite_lz4/ diff --git a/visual/.gitignore b/visual/.gitignore index b11d58f..dea92fc 100644 --- a/visual/.gitignore +++ b/visual/.gitignore @@ -1,16 +1,10 @@ +# Visual C++ +.vs/ *Copy *.db -.vs/ +*.opensdf +*.sdf +*.suo +*.user -# Visual C++ -build/ -VS2005/ -VS2008/ VS2010/bin/ -VS2010/obj/ -VS2012/ -VS2013/ -VS2015/ - -# CMake -cmake/ diff --git a/visual/VS2010/liblz4-dll/lz4-dll.vcxproj b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj index eef1b2e..ac17287 100644 --- a/visual/VS2010/liblz4-dll/lz4-dll.vcxproj +++ b/visual/VS2010/liblz4-dll/lz4-dll.vcxproj @@ -24,6 +24,7 @@ liblz4-dll $(SolutionDir)bin\$(Platform)_$(Configuration)\ $(SolutionDir)bin\obj\$(RootNamespace)_$(Platform)_$(Configuration)\ + liblz4-dll diff --git a/visual/VS2010/lz4.sln b/visual/VS2010/lz4.sln index c88461e..6858164 100644 --- a/visual/VS2010/lz4.sln +++ b/visual/VS2010/lz4.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Express 2012 for Windows Desktop Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lz4", "lz4\lz4.vcxproj", "{E30329AC-0057-4FE0-8FDA-7F650D398C4C}" -- cgit v0.12 From 67fd5dffd9769a3d7fe8436bd79e05df7afd7b05 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 14:05:44 +0100 Subject: updated appveyor.yml --- appveyor.yml | 4 ++-- lib/lz4.h | 2 +- visual/VS2010/lz4.sln | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 85d8ea2..d96ebc8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -70,7 +70,7 @@ build_script: ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% && ECHO *** && msbuild "visual\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" && - COPY visual\VS2010\bin\%PLATFORM%\%CONFIGURATION%\*.exe programs\ + COPY visual\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe programs\ ) test_script: @@ -84,6 +84,6 @@ test_script: lz4 -i1b5 lz4.exe && lz4 -i1b10 lz4.exe && lz4 -i1b15 lz4.exe && - echo lz4 tested && + echo ------- lz4 tested ------- && fullbench.exe -i1 fullbench.exe ) diff --git a/lib/lz4.h b/lib/lz4.h index f7e2097..1a66227 100644 --- a/lib/lz4.h +++ b/lib/lz4.h @@ -58,7 +58,7 @@ extern "C" { #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) +# 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.*/ #else # define LZ4LIB_API #endif diff --git a/visual/VS2010/lz4.sln b/visual/VS2010/lz4.sln index 6858164..d3725ae 100644 --- a/visual/VS2010/lz4.sln +++ b/visual/VS2010/lz4.sln @@ -15,6 +15,9 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datagen", "datagen\datagen.vcxproj", "{D745AE2F-596A-403A-9B91-81A8C6779243}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fullbench-dll", "fullbench-dll\fullbench-dll.vcxproj", "{13992FD2-077E-4954-B065-A428198201A9}" + ProjectSection(ProjectDependencies) = postProject + {9800039D-4AAA-43A4-BB78-FEF6F4836927} = {9800039D-4AAA-43A4-BB78-FEF6F4836927} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution -- cgit v0.12 From ca80a7c8f77f5405cba5b8a52abb1dda78602bf7 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 15:19:29 +0100 Subject: create DLL with MinGW/MSYS --- lib/Makefile | 14 ++++++++++---- tests/Makefile | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 3d251dc..6e58bb0 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -70,21 +70,27 @@ else SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER) endif -default: liblz4 +default: all -all: liblz4 +all: liblz4.a liblz4 -liblz4: *.c +liblz4.a: *.c ifeq ($(BUILD_STATIC),yes) @echo compiling static library @$(CC) $(FLAGS) -c $^ - @$(AR) rcs $@.a *.o + @$(AR) rcs $@ *.o endif + +liblz4: *.c @echo compiling dynamic library $(LIBVER) +ifneq (,$(filter Windows%,$(OS))) + @$(CC) $(FLAGS) -shared $^ -o $@.dll -Wl,--out-implib,liblz4.dll.a +else @$(CC) $(FLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) @echo creating versioned links @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT_MAJOR) @ln -sf $@.$(SHARED_EXT_VER) $@.$(SHARED_EXT) +endif clean: @$(RM) -f core *.o *.a *.$(SHARED_EXT) *.$(SHARED_EXT).* liblz4.pc diff --git a/tests/Makefile b/tests/Makefile index d5f9133..586e8f6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -85,6 +85,14 @@ fullbench : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xx fullbench32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) +fullbench-lib: fullbench.c $(LZ4DIR)/xxhash.c + $(MAKE) -C $(LZ4DIR) liblz4.a + $(CC) $(FLAGS) $^ -o $@$(EXT) $(LZ4DIR)/liblz4.a + +fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c + $(MAKE) -C $(LZ4DIR) liblz4 + $(CC) $(FLAGS) $^ -o $@$(EXT) $(LZ4DIR)/liblz4.dll.a + fuzzer : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/xxhash.o fuzzer.c $(CC) $(FLAGS) $^ -o $@$(EXT) -- cgit v0.12 From 773ae50b477e052146f64c23e3b95d3cbc07db18 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 16:07:28 +0100 Subject: DLL exports only functions defined in liblz4.def --- lib/Makefile | 3 ++- lib/liblz4.def | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/lz4frame.c | 7 +++++-- tests/Makefile | 2 +- 4 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 lib/liblz4.def diff --git a/lib/Makefile b/lib/Makefile index 6e58bb0..70bdfc7 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -84,7 +84,8 @@ endif liblz4: *.c @echo compiling dynamic library $(LIBVER) ifneq (,$(filter Windows%,$(OS))) - @$(CC) $(FLAGS) -shared $^ -o $@.dll -Wl,--out-implib,liblz4.dll.a + @$(CC) $(FLAGS) -DLZ4_DLL_EXPORT=1 -shared $^ -o $@.dll + dlltool -D liblz4.dll -d liblz4.def -l liblz4.dll.a else @$(CC) $(FLAGS) -shared $^ -fPIC $(SONAME_FLAGS) -o $@.$(SHARED_EXT_VER) @echo creating versioned links diff --git a/lib/liblz4.def b/lib/liblz4.def new file mode 100644 index 0000000..0ace223 --- /dev/null +++ b/lib/liblz4.def @@ -0,0 +1,62 @@ +LIBRARY liblz4.dll +EXPORTS + LZ4F_compressBegin + LZ4F_compressBound + LZ4F_compressEnd + LZ4F_compressFrame + LZ4F_compressFrameBound + LZ4F_compressUpdate + LZ4F_createCompressionContext + LZ4F_createDecompressionContext + LZ4F_decompress + LZ4F_flush + LZ4F_freeCompressionContext + LZ4F_freeDecompressionContext + LZ4F_getErrorName + LZ4F_getFrameInfo + LZ4F_getVersion + LZ4F_isError + LZ4_compress + LZ4_compressBound + LZ4_compressHC + LZ4_compressHC_continue + LZ4_compressHC_limitedOutput + LZ4_compressHC_limitedOutput_continue + LZ4_compressHC_limitedOutput_withStateHC + LZ4_compressHC_withStateHC + LZ4_compress_HC + LZ4_compress_HC_continue + LZ4_compress_HC_extStateHC + LZ4_compress_continue + LZ4_compress_default + LZ4_compress_destSize + LZ4_compress_fast + LZ4_compress_fast_continue + LZ4_compress_fast_extState + LZ4_compress_limitedOutput + LZ4_compress_limitedOutput_continue + LZ4_compress_limitedOutput_withState + LZ4_compress_withState + LZ4_createStream + LZ4_createStreamDecode + LZ4_createStreamHC + LZ4_decompress_fast + LZ4_decompress_fast_continue + LZ4_decompress_fast_usingDict + LZ4_decompress_safe + LZ4_decompress_safe_continue + LZ4_decompress_safe_partial + LZ4_decompress_safe_usingDict + LZ4_freeStream + LZ4_freeStreamDecode + LZ4_freeStreamHC + LZ4_loadDict + LZ4_loadDictHC + LZ4_resetStream + LZ4_resetStreamHC + LZ4_saveDict + LZ4_saveDictHC + LZ4_setStreamDecode + LZ4_sizeofState + LZ4_sizeofStateHC + LZ4_versionNumber diff --git a/lib/lz4frame.c b/lib/lz4frame.c index 93657aa..f5b62dc 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -201,7 +201,11 @@ const char* LZ4F_getErrorName(LZ4F_errorCode_t code) return codeError; } -static LZ4F_errorCode_t err0r(LZ4F_errorCodes code) { return (LZ4F_errorCode_t)-(ptrdiff_t)code; } +static LZ4F_errorCode_t err0r(LZ4F_errorCodes code) +{ + LZ4_STATIC_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t)); /* A compilation error here means sizeof(ptrdiff_t) is not large enough */ + return (LZ4F_errorCode_t)-(ptrdiff_t)code; +} unsigned LZ4F_getVersion(void) { return LZ4F_VERSION; } @@ -384,7 +388,6 @@ size_t LZ4F_compressBegin(LZ4F_cctx* cctxPtr, void* dstBuffer, size_t dstMaxSize BYTE* headerStart; size_t requiredBuffSize; - LZ4_STATIC_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t)); /* A compilation error here means sizeof(ptrdiff_t) is not large enough */ if (dstMaxSize < maxFHSize) return err0r(LZ4F_ERROR_dstMaxSize_tooSmall); if (cctxPtr->cStage != 0) return err0r(LZ4F_ERROR_GENERIC); memset(&prefNull, 0, sizeof(prefNull)); diff --git a/tests/Makefile b/tests/Makefile index 586e8f6..6df6381 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -91,7 +91,7 @@ fullbench-lib: fullbench.c $(LZ4DIR)/xxhash.c fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c $(MAKE) -C $(LZ4DIR) liblz4 - $(CC) $(FLAGS) $^ -o $@$(EXT) $(LZ4DIR)/liblz4.dll.a + $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/liblz4.dll.a fuzzer : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/xxhash.o fuzzer.c $(CC) $(FLAGS) $^ -o $@$(EXT) -- cgit v0.12 From 063b4d92e10bb6b430e515e5cdd36b64fce6a01a Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 9 Nov 2016 16:23:08 +0100 Subject: fixed make install --- lib/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index 70bdfc7..6551dd9 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -70,9 +70,11 @@ else SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER) endif -default: all +default: lib -all: liblz4.a liblz4 +all: lib + +lib: liblz4.a liblz4 liblz4.a: *.c ifeq ($(BUILD_STATIC),yes) @@ -111,7 +113,7 @@ liblz4.pc: liblz4.pc.in Makefile -e 's|@VERSION@|$(LIBVER)|' \ $< >$@ -install: liblz4 liblz4.pc +install: lib liblz4.pc @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/ @install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR) @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) -- cgit v0.12