Make SJ4 more portable

This commit is contained in:
Nishi 2026-06-22 05:10:51 +09:00
commit 201d9dba0a
7 changed files with 50 additions and 84 deletions

View file

@ -0,0 +1,9 @@
#include "sj4compat.h"
int sj4_ftruncate(FILE* fp, size_t sz) {
#ifdef _WIN32
return chsize(fileno(fp), sz);
#else
return ftruncate(fileno(fp), sz);
#endif
}

5
lib/sj4common/unlink.c Normal file
View file

@ -0,0 +1,5 @@
#include "sj4compat.h"
int sj4_unlink(const char* path) {
return unlink(path);
}