|
| 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);
|
@@ -301,8 +304,10 @@ static inline time_t filetime_to_time_t(const FILETIME *ft)
|
301 | 304 | /*
|
302 | 305 | * Use mingw specific stat()/lstat()/fstat() implementations on Windows.
|
303 | 306 | */
|
| 307 | +#ifndef __MINGW64_VERSION_MAJOR |
304 | 308 | #define off_t off64_t
|
305 | 309 | #define lseek _lseeki64
|
| 310 | +#endif |
306 | 311 |
|
307 | 312 | /* use struct stat with 64 bit st_size */
|
308 | 313 | #ifdef stat
|
@@ -375,8 +380,12 @@ static inline char *mingw_find_last_dir_sep(const char *path)
|
375 | 380 | int mingw_offset_1st_component(const char *path);
|
376 | 381 | #define offset_1st_component mingw_offset_1st_component
|
377 | 382 | #define PATH_SEP ';'
|
| 383 | +#ifndef __MINGW64_VERSION_MAJOR |
378 | 384 | #define PRIuMAX "I64u"
|
379 | 385 | #define PRId64 "I64d"
|
| 386 | +#else |
| 387 | +#include <inttypes.h> |
| 388 | +#endif |
380 | 389 |
|
381 | 390 | void mingw_open_html(const char *path);
|
382 | 391 | #define open_html mingw_open_html
|
|
0 commit comments