]>
Commit | Line | Data |
---|---|---|
d75f8e61 FL |
1 | #ifndef __MSVC__HEAD |
2 | #define __MSVC__HEAD | |
3 | ||
d75f8e61 FL |
4 | #include <direct.h> |
5 | #include <process.h> | |
6 | #include <malloc.h> | |
7 | ||
8 | /* porting function */ | |
9 | #define inline __inline | |
10 | #define __inline__ __inline | |
11 | #define __attribute__(x) | |
12 | #define va_copy(dst, src) ((dst) = (src)) | |
386ac451 MSO |
13 | #define strncasecmp _strnicmp |
14 | #define ftruncate _chsize | |
d75f8e61 FL |
15 | |
16 | static __inline int strcasecmp (const char *s1, const char *s2) | |
17 | { | |
18 | int size1 = strlen(s1); | |
19 | int sisz2 = strlen(s2); | |
20 | return _strnicmp(s1, s2, sisz2 > size1 ? sisz2 : size1); | |
21 | } | |
22 | ||
23 | #undef ERROR | |
b6f714f8 RJ |
24 | |
25 | /* Use mingw_lstat() instead of lstat()/stat() and mingw_fstat() instead | |
26 | * of fstat(). We add the declaration of these functions here, suppressing | |
27 | * the corresponding declarations in mingw.h, so that we can use the | |
28 | * appropriate structure type (and function) names from the msvc headers. | |
29 | */ | |
30 | #define stat _stat64 | |
31 | int mingw_lstat(const char *file_name, struct stat *buf); | |
32 | int mingw_fstat(int fd, struct stat *buf); | |
33 | #define fstat mingw_fstat | |
34 | #define lstat mingw_lstat | |
d75f8e61 | 35 | #define _stat64(x,y) mingw_lstat(x,y) |
b6f714f8 RJ |
36 | #define ALREADY_DECLARED_STAT_FUNCS |
37 | ||
38 | #include "compat/mingw.h" | |
39 | ||
40 | #undef ALREADY_DECLARED_STAT_FUNCS | |
d75f8e61 | 41 | |
d75f8e61 | 42 | #endif |