From 6b39d122a67284cf4fef21804a03528f9cb70cba Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 27 Sep 2016 20:23:23 +0200 Subject: [PATCH] Support MSVC. --- src/compress_lzma.cpp | 4 ++++ src/conf.h | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compress_lzma.cpp b/src/compress_lzma.cpp index d5e42404..4407c022 100644 --- a/src/compress_lzma.cpp +++ b/src/compress_lzma.cpp @@ -30,6 +30,10 @@ #include "compress.h" #include "mem.h" +#if (ACC_CC_MSC) +# pragma warning(disable: 4456) // -Wno-shadow +#endif + void lzma_compress_config_t::reset() { diff --git a/src/conf.h b/src/conf.h index 75320ef0..73474cc8 100644 --- a/src/conf.h +++ b/src/conf.h @@ -44,7 +44,7 @@ #define ACC_CFG_USE_NEW_STYLE_CASTS 1 #endif #include "miniacc.h" -#if !(ACC_CC_CLANG || ACC_CC_GNUC) +#if !(ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_MSC) // other compilers may work, but we're NOT interested into supporting them # error "only clang and gcc are officially supported" #endif @@ -244,8 +244,13 @@ typedef unsigned char upx_byte; // **************************************************************************/ +#if (ACC_CC_MSC) +#define __packed_struct(s) struct s { +#define __packed_struct_end() }; +#else #define __packed_struct(s) __acc_struct_packed(s) #define __packed_struct_end() __acc_struct_packed_end() +#endif #define UNUSED(var) ACC_UNUSED(var) #define COMPILE_TIME_ASSERT(e) ACC_COMPILE_TIME_ASSERT(e)