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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2015-02-13 12:18:54 +00:00
parent 98f5f875e6
commit 1f9f3b216d

View File

@@ -1,14 +1,13 @@
#include <stdint.h>
#include <wchar.h>
#include <winsock2.h>
#include <ws2tcpip.h>
/*
* things that are not available in header files
*/
typedef int pid_t;
typedef int uid_t;
typedef int socklen_t;
#define hstrerror strerror
#define S_IFLNK 0120000 /* Symbolic link */
#define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
@@ -164,8 +163,10 @@ int pipe(int filedes[2]);
unsigned int sleep (unsigned int seconds);
int mkstemp(char *template);
int gettimeofday(struct timeval *tv, void *tz);
#ifndef __MINGW64_VERSION_MAJOR
struct tm *gmtime_r(const time_t *timep, struct tm *result);
struct tm *localtime_r(const time_t *timep, struct tm *result);
#endif
int getpagesize(void); /* defined in MinGW's libgcc.a */
struct passwd *getpwuid(uid_t uid);
int setitimer(int type, struct itimerval *in, struct itimerval *out);
@@ -285,8 +286,10 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
/*
* Use mingw specific stat()/lstat()/fstat() implementations on Windows.
*/
#ifndef __MINGW64_VERSION_MAJOR
#define off_t off64_t
#define lseek _lseeki64
#endif
/* use struct stat with 64 bit st_size */
#ifdef stat