From b30d55c5d98d8cfc08942052351e60cbd6c2ae7d Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Fri, 25 Jun 2021 20:30:26 +0200 Subject: [PATCH] Removed LZMA "Windows.h" capitalized file name workaround used to cross compile Windows binaries from Linux hosts. This breaks compiling windows binaries if the underlaying filesystem is not case sensitive. An example would be using /mnt/c folder under WSL. Any update on the LZMA SDK needs to be post processed with this command: sed -i 's///' deps/LZMA-SDK/C/*.c deps/LZMA-SDK/C/*.h --- deps/LZMA-SDK/C/Alloc.c | 2 +- deps/LZMA-SDK/C/CpuArch.c | 6 +++--- deps/LZMA-SDK/C/DllSecur.c | 2 +- deps/LZMA-SDK/C/Threads.h | 2 +- include/workarounds/Windows.h | 15 --------------- src/Makefile | 5 ----- 6 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 include/workarounds/Windows.h diff --git a/deps/LZMA-SDK/C/Alloc.c b/deps/LZMA-SDK/C/Alloc.c index 9f249c250..064701a8c 100644 --- a/deps/LZMA-SDK/C/Alloc.c +++ b/deps/LZMA-SDK/C/Alloc.c @@ -6,7 +6,7 @@ #include #ifdef _WIN32 -#include +#include #endif #include diff --git a/deps/LZMA-SDK/C/CpuArch.c b/deps/LZMA-SDK/C/CpuArch.c index bcdbc4cc1..e1443f51b 100644 --- a/deps/LZMA-SDK/C/CpuArch.c +++ b/deps/LZMA-SDK/C/CpuArch.c @@ -217,7 +217,7 @@ BoolInt CPU_Is_InOrder() } #if !defined(MY_CPU_AMD64) && defined(_WIN32) -#include +#include static BoolInt CPU_Sys_Is_SSE_Supported() { OSVERSIONINFO vi; @@ -275,7 +275,7 @@ BoolInt CPU_IsSupported_SHA() // #include #ifdef _WIN32 -#include +#include #endif BoolInt CPU_IsSupported_VAES_AVX2() @@ -327,7 +327,7 @@ BoolInt CPU_IsSupported_PageGB() #ifdef _WIN32 -#include +#include BoolInt CPU_IsSupported_CRC32() { return IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) ? 1 : 0; } diff --git a/deps/LZMA-SDK/C/DllSecur.c b/deps/LZMA-SDK/C/DllSecur.c index b0a555c49..19a22a9f0 100644 --- a/deps/LZMA-SDK/C/DllSecur.c +++ b/deps/LZMA-SDK/C/DllSecur.c @@ -5,7 +5,7 @@ #ifdef _WIN32 -#include +#include #include "DllSecur.h" diff --git a/deps/LZMA-SDK/C/Threads.h b/deps/LZMA-SDK/C/Threads.h index 8d4a10df9..c555c8b97 100644 --- a/deps/LZMA-SDK/C/Threads.h +++ b/deps/LZMA-SDK/C/Threads.h @@ -5,7 +5,7 @@ #define __7Z_THREADS_H #ifdef _WIN32 -#include +#include #else #if !defined(__APPLE__) && !defined(_AIX) diff --git a/include/workarounds/Windows.h b/include/workarounds/Windows.h deleted file mode 100644 index 74fb132e5..000000000 --- a/include/workarounds/Windows.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Author......: See docs/credits.txt - * License.....: MIT - */ - -#ifndef _WINDOWS_H -#define _WINDOWS_H - -// This is a workaround for files asking to include Windows.h instead of windows.h -// The problem is that MinGW provides only windows.h -// LZMA SDK will fail to cross compile for Windows on Linux - -#include - -#endif // _WINDOWS_H diff --git a/src/Makefile b/src/Makefile index 703885d59..4f99425e6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -254,11 +254,6 @@ ifeq ($(USE_SYSTEM_LZMA),1) LFLAGS += -llzmasdk endif -## LZMA workaround for MSYS2 -ifeq ($(USE_SYSTEM_LZMA),0) -CFLAGS += -Iinclude/workarounds -endif - # ZLIB CFLAGS += -I$(DEPS_ZLIB_PATH) -I$(DEPS_ZLIB_PATH)/contrib ifeq ($(USE_SYSTEM_ZLIB),1)