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