From 334e0d64ce58f92d313d67041344c4986cba191a Mon Sep 17 00:00:00 2001 From: Daniel d'Andrada Date: Fri, 4 Oct 2019 14:11:18 +0200 Subject: [PATCH] Fix LFS check Code should check for__USE_LARGEFILE64, not _LARGEFILE64_SOURCE _LARGEFILE64_SOURCE should be used only for setting a preference when compiling code (either explicitly or by the compiler itself). Then, according to its value, features.h will take care define things like __USE_LARGEFILE64 appropriately. As a side-effect, this patch adds support for clang. When building with clang one has to explicitly define _LARGEFILE64_SOURCE if he want to use the *64 api. --- miniz_zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniz_zip.c b/miniz_zip.c index 7358f0b..e4877d2 100644 --- a/miniz_zip.c +++ b/miniz_zip.c @@ -97,7 +97,7 @@ static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) #define MZ_FFLUSH fflush #define MZ_FREOPEN(f, m, s) freopen(f, m, s) #define MZ_DELETE_FILE remove -#elif defined(__GNUC__) && defined(_LARGEFILE64_SOURCE) +#elif defined(__USE_LARGEFILE64) // gcc, clang #ifndef MINIZ_NO_TIME #include #endif