1 #ifndef MY_STAT_H
2 #define MY_STAT_H
3
4 #ifdef HAVE_SYS_STAT_H
5 # include <sys/stat.h>
6 #else
7 # include <stdint.h>
8 # if defined _MSC_VER
9 struct _stat
10 # else
11 struct stat
12 # endif
13 {
14 uint32_t st_dev;
15 uint32_t st_ino;
16 uint16_t st_mode;
17 int16_t st_nlink;
18 int16_t st_uid;
19 int16_t st_gid;
20 uint32_t st_rdev;
21 size_t st_size;
22 size_t st_atime;
23 size_t st_mtime;
24 size_t st_ctime;
25 };
26 #endif
27
28 #if defined _MSC_VER & !defined HAVE_SYS_STAT_H
29 typedef struct _stat struct_stat_t;
30 #else
31 typedef struct stat struct_stat_t;
32 #endif
33
34 #if defined _MSC_VER
35 int _access (const char *path, int mode);
36 # define access(fn, m) _access (fn, m)
37 # ifndef S_ISREG
38 # define S_ISREG(m) ((m & 0170000) == _S_IFREG)
39 # endif
40 # ifndef W_OK
41 # define W_OK 0
42 # endif
43 #endif // _MSC_VER
44
45 #endif // MY_STAT_H