Skip to content

Commit 8e8c741

Browse files
committed
Port header fixes from MSys2
MSys2' Git build script has some changes we should put into Git for Windows' source code proper. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b9e7a55 commit 8e8c741

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compat/mingw.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
#include <stdint.h>
2+
#include <wchar.h>
13
#include <winsock2.h>
24
#include <ws2tcpip.h>
3-
45
/*
56
* things that are not available in header files
67
*/
78

8-
typedef int pid_t;
99
typedef int uid_t;
1010
typedef int socklen_t;
11-
#define hstrerror strerror
1211

1312
#define S_IFLNK 0120000 /* Symbolic link */
1413
#define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
@@ -159,8 +158,10 @@ int pipe(int filedes[2]);
159158
unsigned int sleep (unsigned int seconds);
160159
int mkstemp(char *template);
161160
int gettimeofday(struct timeval *tv, void *tz);
161+
#ifndef __MINGW64_VERSION_MAJOR
162162
struct tm *gmtime_r(const time_t *timep, struct tm *result);
163163
struct tm *localtime_r(const time_t *timep, struct tm *result);
164+
#endif
164165
int getpagesize(void); /* defined in MinGW's libgcc.a */
165166
struct passwd *getpwuid(uid_t uid);
166167
int setitimer(int type, struct itimerval *in, struct itimerval *out);
@@ -296,8 +297,10 @@ static inline time_t filetime_to_time_t(const FILETIME *ft)
296297
/*
297298
* Use mingw specific stat()/lstat()/fstat() implementations on Windows.
298299
*/
300+
#ifndef __MINGW64_VERSION_MAJOR
299301
#define off_t off64_t
300302
#define lseek _lseeki64
303+
#endif
301304

302305
/* use struct stat with 64 bit st_size */
303306
#ifdef stat

0 commit comments

Comments
 (0)