]> git.ipfire.org Git - thirdparty/git.git/blame - compat/msvc.h
config: drop cf validity check in get_next_char()
[thirdparty/git.git] / compat / msvc.h
CommitLineData
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>
7b05949b 7#include <io.h>
d75f8e61
FL
8
9/* porting function */
10#define inline __inline
11#define __inline__ __inline
12#define __attribute__(x)
386ac451
MSO
13#define strncasecmp _strnicmp
14#define ftruncate _chsize
d0f9dbb9
RJ
15#define strtoull _strtoui64
16#define strtoll _strtoi64
d75f8e61
FL
17
18static __inline int strcasecmp (const char *s1, const char *s2)
19{
20 int size1 = strlen(s1);
21 int sisz2 = strlen(s2);
22 return _strnicmp(s1, s2, sisz2 > size1 ? sisz2 : size1);
23}
24
25#undef ERROR
b6f714f8
RJ
26
27/* Use mingw_lstat() instead of lstat()/stat() and mingw_fstat() instead
28 * of fstat(). We add the declaration of these functions here, suppressing
29 * the corresponding declarations in mingw.h, so that we can use the
30 * appropriate structure type (and function) names from the msvc headers.
31 */
32#define stat _stat64
33int mingw_lstat(const char *file_name, struct stat *buf);
34int mingw_fstat(int fd, struct stat *buf);
35#define fstat mingw_fstat
36#define lstat mingw_lstat
d75f8e61 37#define _stat64(x,y) mingw_lstat(x,y)
b6f714f8
RJ
38#define ALREADY_DECLARED_STAT_FUNCS
39
40#include "compat/mingw.h"
41
42#undef ALREADY_DECLARED_STAT_FUNCS
d75f8e61 43
d75f8e61 44#endif