fix: Do not #include <sys/types.h> on Windows

Instead, we provide our own typedef for mode_t, uid_t and gid_t, and we get time_t from <time.h>.
This commit is contained in:
apio 2023-02-05 14:22:31 +01:00
parent 5bfc7e45ac
commit 8cb5175630
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 8 additions and 1 deletions

View File

@ -10,7 +10,15 @@
#define MINITAR_H #define MINITAR_H
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <time.h>
#ifdef _MSC_VER
typedef unsigned int mode_t;
typedef unsigned int gid_t;
typedef unsigned int uid_t;
#else
#include <sys/types.h> #include <sys/types.h>
#endif
struct minitar struct minitar
{ {

View File

@ -13,7 +13,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h>
#ifndef __TINYC__ #ifndef __TINYC__
#include <stdnoreturn.h> #include <stdnoreturn.h>