From 3aaa1dae4e49d3fcf8c85568de79c5f2eafaeacd Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 15 Feb 2017 09:17:39 +0100 Subject: [PATCH 1/4] simplified zlib detection --- programs/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index efe684432..0a9ab5a79 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -67,9 +67,8 @@ endif # zlib detection VOID = /dev/null -HAVE_ZLIB := $(shell printf '\#include \nint main(){}' | $(CC) -o have_zlib -x c - -lz 2> $(VOID) && echo 1 || echo 0) +HAVE_ZLIB := $(shell printf '\#include \nint main(){}' | $(CC) -o have_zlib -x c - -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0) ifeq ($(HAVE_ZLIB), 1) -TEMP := $(shell rm have_zlib$(EXT)) ZLIBCPP = -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS ZLIBLD = -lz endif From 6e59b3ce0180b02e81bfa8fc1829567cb0c2e1a9 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 15 Feb 2017 17:03:16 +0100 Subject: [PATCH 2/4] added UTIL_fseek --- programs/util.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/programs/util.h b/programs/util.h index 364aa650f..c03bd1d19 100644 --- a/programs/util.h +++ b/programs/util.h @@ -39,6 +39,20 @@ extern "C" { #include "mem.h" /* U32, U64 */ +/* ************************************************************ +* Avoid fseek()'s 2GiB barrier with MSVC, MacOS, *BSD, MinGW +***************************************************************/ +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +# define UTIL_fseek _fseeki64 +#elif !defined(__64BIT__) && (PLATFORM_POSIX_VERSION >= 200112L) /* No point defining Large file for 64 bit */ +# define UTIL_fseek fseeko +#elif defined(__MINGW32__) && defined(__MSVCRT__) && !defined(__STRICT_ANSI__) && !defined(__NO_MINGW_LFS) +# define UTIL_fseek fseeko64 +#else +# define UTIL_fseek fseek +#endif + + /*-**************************************** * Sleep functions: Windows - Posix - others ******************************************/ From acb6e57ad211a0e897310acf5bfec2b72da23002 Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Wed, 15 Feb 2017 17:13:35 +0100 Subject: [PATCH 3/4] use FindFirstFileA instead of FindFirstFile --- programs/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/util.h b/programs/util.h index c03bd1d19..0f588f110 100644 --- a/programs/util.h +++ b/programs/util.h @@ -269,7 +269,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ { char* path; int dirLength, fnameLength, pathLength, nbFiles = 0; - WIN32_FIND_DATA cFile; + WIN32_FIND_DATAA cFile; HANDLE hFile; dirLength = (int)strlen(dirName); @@ -281,7 +281,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ path[dirLength+1] = '*'; path[dirLength+2] = 0; - hFile=FindFirstFile(path, &cFile); + hFile=FindFirstFileA(path, &cFile); if (hFile == INVALID_HANDLE_VALUE) { fprintf(stderr, "Cannot open directory '%s'\n", dirName); return 0; @@ -318,7 +318,7 @@ UTIL_STATIC int UTIL_prepareFileList(const char *dirName, char** bufStart, size_ } } free(path); - } while (FindNextFile(hFile, &cFile)); + } while (FindNextFileA(hFile, &cFile)); FindClose(hFile); return nbFiles; From 65add2934a0c9f0e83b82b060121542c48286b3f Mon Sep 17 00:00:00 2001 From: Przemyslaw Skibinski Date: Fri, 17 Feb 2017 07:54:37 +0100 Subject: [PATCH 4/4] circle.yml: set FUZZERTEST=-T4mn --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index d8b033597..69c988545 100644 --- a/circle.yml +++ b/circle.yml @@ -33,7 +33,7 @@ dependencies: if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C tests test-zstream && make clean; fi - | if [[ "$CIRCLE_NODE_INDEX" == "0" ]]; then make -C tests test-zstd && make clean; fi - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C tests test-fuzzer && make clean; fi + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C tests test-fuzzer FUZZERTEST=-T4mn && make clean; fi test: override: