]>
Commit | Line | Data |
---|---|---|
e8cc449f RJ |
1 | #ifndef INCLUDE_msvc_compat__ |
2 | #define INCLUDE_msvc_compat__ | |
3 | ||
4 | #if defined(_MSC_VER) | |
5 | ||
6 | /* access() mode parameter #defines */ | |
7 | # define F_OK 0 /* existence check */ | |
8 | # define W_OK 2 /* write mode check */ | |
9 | # define R_OK 4 /* read mode check */ | |
10 | ||
e8cc449f RJ |
11 | # define lseek _lseeki64 |
12 | # define stat _stat64 | |
13 | # define fstat _fstat64 | |
14 | ||
15 | /* stat: file mode type testing macros */ | |
732eb0a8 SS |
16 | # define _S_IFLNK 0120000 |
17 | # define S_IFLNK _S_IFLNK | |
18 | ||
e8cc449f RJ |
19 | # define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) |
20 | # define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) | |
21 | # define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) | |
ae496955 | 22 | # define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) |
e8cc449f | 23 | |
63fadf99 | 24 | # define mode_t unsigned short |
25 | ||
8133afef | 26 | /* case-insensitive string comparison */ |
07234716 SS |
27 | # define strcasecmp _stricmp |
28 | # define strncasecmp _strnicmp | |
29 | ||
824f4acd VM |
30 | #if (_MSC_VER >= 1600) |
31 | # include <stdint.h> | |
32 | #else | |
e8cc449f RJ |
33 | /* add some missing <stdint.h> typedef's */ |
34 | typedef signed char int8_t; | |
35 | typedef unsigned char uint8_t; | |
36 | ||
37 | typedef short int16_t; | |
38 | typedef unsigned short uint16_t; | |
39 | ||
40 | typedef long int32_t; | |
41 | typedef unsigned long uint32_t; | |
42 | ||
43 | typedef long long int64_t; | |
44 | typedef unsigned long long uint64_t; | |
45 | ||
46 | typedef long long intmax_t; | |
47 | typedef unsigned long long uintmax_t; | |
824f4acd | 48 | #endif |
e8cc449f RJ |
49 | |
50 | #endif | |
51 | ||
52 | #endif /* INCLUDE_msvc_compat__ */ |