From 481c9003fa41e75731bc463cdfa4310e91d5ea4c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Aug 2016 10:41:13 -0400 Subject: libarchive: Fix include order in xxhash.c We need to include `archive_platform.h` before any system headers in order to ensure that `_WIN32_WINNT` is defined early enough. --- Utilities/cmlibarchive/libarchive/xxhash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Utilities/cmlibarchive/libarchive/xxhash.c b/Utilities/cmlibarchive/libarchive/xxhash.c index d7f8e96..262fecb 100644 --- a/Utilities/cmlibarchive/libarchive/xxhash.c +++ b/Utilities/cmlibarchive/libarchive/xxhash.c @@ -29,12 +29,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. You can contact the author at : - xxHash source repository : http://code.google.com/p/xxhash/ */ -#include -#include #include "archive_platform.h" #include "archive_xxhash.h" +#include +#include + #ifdef HAVE_LIBLZ4 /*************************************** -- cgit v0.12 From 27591a541c3ee7c0a941295f25610631bf18ca74 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 17 Aug 2016 10:43:26 -0400 Subject: Define WIN32_LEAN_AND_MEAN for CMake sources on Windows This reduces APIs included by `windows.h`. We can include the headers for those APIs as needed. --- Source/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index b68675d..e63bf5a 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -45,9 +45,12 @@ endif() set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) -# ensure Unicode friendly APIs are used on Windows if(WIN32) + # ensure Unicode friendly APIs are used on Windows add_definitions(-DUNICODE -D_UNICODE) + + # minimize windows.h content + add_definitions(-DWIN32_LEAN_AND_MEAN) endif() # configure the .dox.in file -- cgit v0.12