Make SJ4 more portable
This commit is contained in:
parent
df18e66b18
commit
201d9dba0a
7 changed files with 50 additions and 84 deletions
9
lib/sj4common/ftruncate.c
Normal file
9
lib/sj4common/ftruncate.c
Normal 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
5
lib/sj4common/unlink.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include "sj4compat.h"
|
||||
|
||||
int sj4_unlink(const char* path) {
|
||||
return unlink(path);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue