diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/compat/time.h | 6 | ||||
| -rw-r--r-- | include/compat/win32netcompat.h | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/include/compat/time.h b/include/compat/time.h index 9ed9c03..99a2001 100644 --- a/include/compat/time.h +++ b/include/compat/time.h | |||
| @@ -9,11 +9,15 @@ | |||
| 9 | #else | 9 | #else |
| 10 | #include <../include/time.h> | 10 | #include <../include/time.h> |
| 11 | #endif | 11 | #endif |
| 12 | #define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tm) : NULL) | ||
| 13 | #else | 12 | #else |
| 14 | #include_next <time.h> | 13 | #include_next <time.h> |
| 15 | #endif | 14 | #endif |
| 16 | 15 | ||
| 16 | #ifdef _WIN32 | ||
| 17 | struct tm *__gmtime_r(const time_t * t, struct tm * tm); | ||
| 18 | #define gmtime_r(tp, tm) __gmtime_r(tp, tm) | ||
| 19 | #endif | ||
| 20 | |||
| 17 | #ifndef HAVE_TIMEGM | 21 | #ifndef HAVE_TIMEGM |
| 18 | time_t timegm(struct tm *tm); | 22 | time_t timegm(struct tm *tm); |
| 19 | #endif | 23 | #endif |
diff --git a/include/compat/win32netcompat.h b/include/compat/win32netcompat.h index 452cfba..933f083 100644 --- a/include/compat/win32netcompat.h +++ b/include/compat/win32netcompat.h | |||
| @@ -11,13 +11,18 @@ | |||
| 11 | #ifdef _WIN32 | 11 | #ifdef _WIN32 |
| 12 | 12 | ||
| 13 | #include <ws2tcpip.h> | 13 | #include <ws2tcpip.h> |
| 14 | #include <errno.h> | ||
| 15 | #include <unistd.h> | ||
| 14 | 16 | ||
| 17 | #ifndef SHUT_RDWR | ||
| 15 | #define SHUT_RDWR SD_BOTH | 18 | #define SHUT_RDWR SD_BOTH |
| 19 | #endif | ||
| 20 | #ifndef SHUT_RD | ||
| 16 | #define SHUT_RD SD_RECEIVE | 21 | #define SHUT_RD SD_RECEIVE |
| 22 | #endif | ||
| 23 | #ifndef SHUT_WR | ||
| 17 | #define SHUT_WR SD_SEND | 24 | #define SHUT_WR SD_SEND |
| 18 | 25 | #endif | |
| 19 | #include <errno.h> | ||
| 20 | #include <unistd.h> | ||
| 21 | 26 | ||
| 22 | int posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); | 27 | int posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); |
| 23 | 28 | ||
