Can't help
internal error comes with x64
Pelles C: with C11
struct tm * localtime_s(const time_t * restrict timer, struct tm * restrict dst);
msvc:
errno_t localtime_s(struct tm* const tmDest, time_t const* const sourceTime);
so have to define
_POSIX_C_SOURCEMy test defines for x86 was: _POSIX_C_SOURCE _wstat64=_wstat _stat64=_stat __stat64=_stat _chsize_s=chsize
x64 have stat64 and wstat64 in crt64
low interest to split source for testing
EDIT:
test with:
//#define MINIZ_HEADER_FILE_ONLY // OK
#define MINIZ_NO_ARCHIVE_APIS
#define MINIZ_NO_ARCHIVE_WRITING_APIS
#define MINIZ_NO_STDIO
#define MINIZ_NO_TIME
#define MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
#define MINIZ_NO_INFLATE_APIS
#define MINIZ_NO_MALLOC
#define MINIZ_UNALIGNED_USE_MEMCPY
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES
//#define MINIZ_NO_DEFLATE_APIS // fatal error inside this code
#include "miniz.h"
errors
Building test_1.obj.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(689): error #1021: Invalid operand '&&' in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(689): error #1019: Syntax error in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(2957): error #1021: Invalid operand '&&' in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(2957): error #1019: Syntax error in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(3261): error #1019: Syntax error in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(3385): error #1021: Invalid operand '&&' in preprocessor expression.
C:\code\PellesC\MiniZ\zip-v3.0.2\src\miniz.h(3385): error #1019: Syntax error in preprocessor expression.
fatal error: Internal error: 'Access violation' at 0x000000013f703e99.
*** Error code: 1 ***
Done.
so split code to header miniz.h miniz_tdef.c and miniz_tinfl.c for using it
split code from
MINIZ_NO_ARCHIVE_APIS
MINIZ_NO_ARCHIVE_WRITING_APIS
this was one problem, that need modification
#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
static void mz_zip_time_t_to_dos_time(MZ_TIME_T time, mz_uint16 *pDOS_time,
mz_uint16 *pDOS_date) {
#ifdef __POCC__
struct tm *tm = localtime(&time);
#elif_MSC_VER
struct tm tm_struct;
struct tm *tm = &tm_struct;
errno_t err = localtime_s(tm, &time);
if (err) {
*pDOS_date = 0;
*pDOS_time = 0;
return;
}
#else
struct tm *tm = localtime(&time);
#endif /* #ifdef _MSC_VER */
EDIT:compiler crash in function
static mz_bool tdefl_compress_normal(