Skip to content

Commit 1f9f3b2

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 98f5f87 commit 1f9f3b2

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)
@@ -164,8 +163,10 @@ int pipe(int filedes[2]);
164163
unsigned int sleep (unsigned int seconds);
165164
int mkstemp(char *template);
166165
int gettimeofday(struct timeval *tv, void *tz);
166+
#ifndef __MINGW64_VERSION_MAJOR
167167
struct tm *gmtime_r(const time_t *timep, struct tm *result);
168168
struct tm *localtime_r(const time_t *timep, struct tm *result);
169+
#endif
169170
int getpagesize(void); /* defined in MinGW's libgcc.a */
170171
struct passwd *getpwuid(uid_t uid);
171172
int setitimer(int type, struct itimerval *in, struct itimerval *out);
@@ -285,8 +286,10 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
285286
/*
286287
* Use mingw specific stat()/lstat()/fstat() implementations on Windows.
287288
*/
289+
#ifndef __MINGW64_VERSION_MAJOR
288290
#define off_t off64_t
289291
#define lseek _lseeki64
292+
#endif
290293

291294
/* use struct stat with 64 bit st_size */
292295
#ifdef stat

0 commit comments

Comments
 (0)