4 /* Win32 define for porting git*/
8 typedef unsigned short _mode_t;
11 typedef _mode_t mode_t;
13 #endif /* Not _MODE_T_ */
17 typedef long _ssize_t;
26 #endif /* Not _OFF_T_ */
30 typedef _ssize_t ssize_t;
32 #endif /* Not _SSIZE_T_ */
34 typedef signed char int8_t;
35 typedef unsigned char uint8_t;
36 typedef short int16_t;
37 typedef unsigned short uint16_t;
39 typedef unsigned uint32_t;
40 typedef long long int64_t;
41 typedef unsigned long long uint64_t;
43 typedef long long intmax_t;
44 typedef unsigned long long uintmax_t;
46 typedef int64_t off64_t;
48 #define STDOUT_FILENO 1
49 #define STDERR_FILENO 2
51 /* Some defines for _access nAccessMode (MS doesn't define them, but
52 * it doesn't seem to hurt to add them). */
53 #define F_OK 0 /* Check for file existence */
54 /* Well maybe it does hurt. On newer versions of MSVCRT, an access mode
55 of 1 causes invalid parameter error. */
56 #define X_OK 0 /* MS access() doesn't check for execute permission. */
57 #define W_OK 2 /* Check for write permission */
58 #define R_OK 4 /* Check for read permission */
60 #define _S_IFIFO 0x1000 /* FIFO */
61 #define _S_IFCHR 0x2000 /* Character */
62 #define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
63 #define _S_IFDIR 0x4000 /* Directory */
64 #define _S_IFREG 0x8000 /* Regular */
66 #define _S_IFMT 0xF000 /* File type mask */
68 #define _S_IXUSR _S_IEXEC
69 #define _S_IWUSR _S_IWRITE
70 #define _S_IRUSR _S_IREAD
71 #define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
73 #define S_IFIFO _S_IFIFO
74 #define S_IFCHR _S_IFCHR
75 #define S_IFBLK _S_IFBLK
76 #define S_IFDIR _S_IFDIR
77 #define S_IFREG _S_IFREG
78 #define S_IFMT _S_IFMT
79 #define S_IEXEC _S_IEXEC
80 #define S_IWRITE _S_IWRITE
81 #define S_IREAD _S_IREAD
82 #define S_IRWXU _S_IRWXU
83 #define S_IXUSR _S_IXUSR
84 #define S_IWUSR _S_IWUSR
85 #define S_IRUSR _S_IRUSR
88 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
89 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
90 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)