thirdparty/zip: properly include utime.h and set defines for FreeBSD (#19285)

This commit is contained in:
Kim Shrier 2023-09-06 12:42:31 -06:00 committed by GitHub
parent 43ccba3713
commit 60b901dda2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View File

@ -7,7 +7,7 @@ freebsd_instance:
freebsd_task:
name: FreeBSD Code CI
timeout_in: 31m
skip: "!changesInclude('.cirrus.yml', '**.{v,vsh}')"
skip: "!changesInclude('.cirrus.yml', '**.{v,vsh}', '**.c', '**.h')"
install_script: pkg install -y git
diagnose_env_script: |
## env ## CIRRUS_WORKING_DIR is /tmp/cirrus-ci-build
@ -29,6 +29,9 @@ freebsd_task:
diagnose_math_script: |
echo 'Diagnose vlib/math/math_test.v'
./v -stats vlib/math/math_test.v
test_zip_modules: |
echo 'Test modules using thirdparty/zip'
./v test vlib/compress/ vlib/szip/
test_self_script: |
echo 'Run test-self'
VTEST_JUST_ESSENTIAL=1 ./v test-self

View File

@ -4926,6 +4926,24 @@ static int mz_mkdir(const char *pDirname) {
#define MZ_DELETE_FILE remove
#define MZ_MKDIR(d) _mkdir(d)
#elif defined(__FreeBSD__)
#ifndef MINIZ_NO_TIME
#include <utime.h>
#endif
#define MZ_FOPEN(f, m) fopen(f, m)
#define MZ_FCLOSE fclose
#define MZ_FREAD fread
#define MZ_FWRITE fwrite
#define MZ_FTELL64 ftello
#define MZ_FSEEK64 fseeko
#define MZ_FILE_STAT_STRUCT stat
#define MZ_FILE_STAT stat
#define MZ_FFLUSH fflush
#define MZ_FREOPEN(p, m, s) freopen(p, m, s)
#define MZ_DELETE_FILE remove
#define MZ_MKDIR(d) mkdir(d, 0755)
#elif defined(__TINYC__)
#ifndef MINIZ_NO_TIME
#include <sys/utime.h>