@@ -45,6 +45,8 @@ extern "C" {
45
45
#include <process.h> /* _execl() */
46
46
#endif /* _INC_PROCESS */
47
47
48
+ #include <sys/stat.h> /* */
49
+
48
50
#ifndef access
49
51
#define access _access
50
52
#endif /* access */
@@ -121,6 +123,10 @@ extern "C" {
121
123
#define rmdir _rmdir
122
124
#endif /* rmdir */
123
125
126
+ #ifndef unlink
127
+ #define unlink _unlink
128
+ #endif /* unlink */
129
+
124
130
/* permission bits below must be defined in sys/stat.h, but MSVC lacks them */
125
131
126
132
#ifndef S_IRWXU
@@ -203,6 +209,102 @@ extern "C" {
203
209
#define S_IXUGO 0111
204
210
#endif /* S_IXUGO */
205
211
212
+ #ifndef _S_IFMT
213
+ #define _S_IFMT 0xF000
214
+ #endif /* _S_IFMT */
215
+
216
+ #ifndef _S_IFIFO
217
+ #define _S_IFIFO 0x1000
218
+ #endif /* _S_IFIFO */
219
+
220
+ #ifndef _S_IFCHR
221
+ #define _S_IFCHR 0x2000
222
+ #endif /* _S_IFCHR */
223
+
224
+ #ifndef _S_IFDIR
225
+ #define _S_IFDIR 0x4000
226
+ #endif /* _S_IFDIR */
227
+
228
+ #ifndef _S_IFBLK
229
+ #define _S_IFBLK 0x6000
230
+ #endif /* _S_IFBLK */
231
+
232
+ #ifndef _S_IFREG
233
+ #define _S_IFREG 0x8000
234
+ #endif /* _S_IFREG */
235
+
236
+ #ifndef _S_IFLNK
237
+ #define _S_IFLNK 0xA000
238
+ #endif /* _S_IFLNK */
239
+
240
+ #ifndef _S_IFSOCK
241
+ #define _S_IFSOCK 0xC000
242
+ #endif /* _S_IFSOCK */
243
+
244
+ #ifndef S_IFMT
245
+ #define S_IFMT _S_IFMT
246
+ #endif /* S_IFMT */
247
+
248
+ #ifndef S_IFIFO
249
+ #define S_IFIFO _S_IFIFO
250
+ #endif /* S_IFIFO */
251
+
252
+ #ifndef S_IFCHR
253
+ #define S_IFCHR _S_IFCHR
254
+ #endif /* S_IFCHR */
255
+
256
+ #ifndef S_IFDIR
257
+ #define S_IFDIR _S_IFDIR
258
+ #endif /* S_IFDIR */
259
+
260
+ #ifndef S_IFBLK
261
+ #define S_IFBLK _S_IFBLK
262
+ #endif /* S_IFBLK */
263
+
264
+ #ifndef S_IFREG
265
+ #define S_IFREG _S_IFREG
266
+ #endif /* S_IFREG */
267
+
268
+ #ifndef S_IFLNK
269
+ #define S_IFLNK _S_IFLNK
270
+ #endif /* S_IFLNK */
271
+
272
+ #ifndef S_IFSOCK
273
+ #define S_IFSOCK _S_IFSOCK
274
+ #endif /* S_IFSOCK */
275
+
276
+ #ifndef S_ISTYPE
277
+ #define S_ISTYPE (mode , mask ) (((mode) & S_IFMT) == (mask))
278
+ #endif /* S_ISTYPE */
279
+
280
+ #ifndef S_ISFIFO
281
+ #define S_ISFIFO (mode ) S_ISTYPE(mode, S_IFIFO)
282
+ #endif /* S_ISFIFO */
283
+
284
+ #ifndef S_ISCHR
285
+ #define S_ISCHR (mode ) S_ISTYPE(mode, S_IFCHR)
286
+ #endif /* S_ISCHR */
287
+
288
+ #ifndef S_ISDIR
289
+ #define S_ISDIR (mode ) S_ISTYPE(mode, S_IFDIR)
290
+ #endif /* S_ISDIR */
291
+
292
+ #ifndef S_ISBLK
293
+ #define S_ISBLK (mode ) S_ISTYPE(mode, S_IFBLK)
294
+ #endif /* S_ISBLK */
295
+
296
+ #ifndef S_ISREG
297
+ #define S_ISREG (mode ) S_ISTYPE(mode, S_IFREG)
298
+ #endif /* S_ISREG */
299
+
300
+ #ifndef S_ISLNK
301
+ #define S_ISLNK (mode ) S_ISTYPE(mode, S_IFLNK)
302
+ #endif /* S_ISLNK */
303
+
304
+ #ifndef S_ISSOCK
305
+ #define S_ISSOCK (mode ) S_ISTYPE(mode, S_IFSOCK)
306
+ #endif /* S_ISSOCK */
307
+
206
308
#ifdef __cplusplus
207
309
}
208
310
#endif /* __cplusplus */
0 commit comments