|
| 1 | +#include <stdint.h> |
| 2 | +#include <wchar.h> |
1 | 3 | #include <winsock2.h>
|
2 | 4 | #include <ws2tcpip.h>
|
3 |
| - |
4 | 5 | /*
|
5 | 6 | * things that are not available in header files
|
6 | 7 | */
|
7 | 8 |
|
8 |
| -typedef int pid_t; |
9 | 9 | typedef int uid_t;
|
10 | 10 | typedef int socklen_t;
|
11 |
| -#define hstrerror strerror |
12 | 11 |
|
13 | 12 | #define S_IFLNK 0120000 /* Symbolic link */
|
14 | 13 | #define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
|
@@ -92,8 +91,10 @@ static inline int symlink(const char *oldpath, const char *newpath)
|
92 | 91 | { errno = ENOSYS; return -1; }
|
93 | 92 | static inline int fchmod(int fildes, mode_t mode)
|
94 | 93 | { errno = ENOSYS; return -1; }
|
| 94 | +#ifndef __MINGW64_VERSION_MAJOR |
95 | 95 | static inline pid_t fork(void)
|
96 | 96 | { errno = ENOSYS; return -1; }
|
| 97 | +#endif |
97 | 98 | static inline unsigned int alarm(unsigned int seconds)
|
98 | 99 | { return 0; }
|
99 | 100 | static inline int fsync(int fd)
|
@@ -164,8 +165,10 @@ int pipe(int filedes[2]);
|
164 | 165 | unsigned int sleep (unsigned int seconds);
|
165 | 166 | int mkstemp(char *template);
|
166 | 167 | int gettimeofday(struct timeval *tv, void *tz);
|
| 168 | +#ifndef __MINGW64_VERSION_MAJOR |
167 | 169 | struct tm *gmtime_r(const time_t *timep, struct tm *result);
|
168 | 170 | struct tm *localtime_r(const time_t *timep, struct tm *result);
|
| 171 | +#endif |
169 | 172 | int getpagesize(void); /* defined in MinGW's libgcc.a */
|
170 | 173 | struct passwd *getpwuid(uid_t uid);
|
171 | 174 | int setitimer(int type, struct itimerval *in, struct itimerval *out);
|
@@ -285,8 +288,10 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
|
285 | 288 | /*
|
286 | 289 | * Use mingw specific stat()/lstat()/fstat() implementations on Windows.
|
287 | 290 | */
|
| 291 | +#ifndef __MINGW64_VERSION_MAJOR |
288 | 292 | #define off_t off64_t
|
289 | 293 | #define lseek _lseeki64
|
| 294 | +#endif |
290 | 295 |
|
291 | 296 | /* use struct stat with 64 bit st_size */
|
292 | 297 | #ifdef stat
|
@@ -359,8 +364,12 @@ static inline char *mingw_find_last_dir_sep(const char *path)
|
359 | 364 | int mingw_offset_1st_component(const char *path);
|
360 | 365 | #define offset_1st_component mingw_offset_1st_component
|
361 | 366 | #define PATH_SEP ';'
|
| 367 | +#ifndef __MINGW64_VERSION_MAJOR |
362 | 368 | #define PRIuMAX "I64u"
|
363 | 369 | #define PRId64 "I64d"
|
| 370 | +#else |
| 371 | +#include <inttypes.h> |
| 372 | +#endif |
364 | 373 |
|
365 | 374 | void mingw_open_html(const char *path);
|
366 | 375 | #define open_html mingw_open_html
|
|
0 commit comments