Skip to content

Commit

Permalink
fix ftruncate for tcc on Windows (#260)
Browse files Browse the repository at this point in the history
* fix ftruncate for tcc on Windows

* Update zip.c
  • Loading branch information
Dialga committed Jun 3, 2022
1 parent 4f23190 commit 55b5d81
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
#define fileno _fileno
#endif

#if defined(__TINYC__) && (defined(_WIN32) || defined(_WIN64))
#include <io.h>

#define ftruncate(fd, sz) (-(_chsize_s((fd), (sz)) != 0))
#define fileno _fileno
#endif

#ifndef HAS_DEVICE
#define HAS_DEVICE(P) 0
#endif
Expand Down

0 comments on commit 55b5d81

Please sign in to comment.