diff options
Diffstat (limited to 'src/platform/platform_interface.h')
-rw-r--r-- | src/platform/platform_interface.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/platform/platform_interface.h b/src/platform/platform_interface.h index 6e88be50..1fc3399e 100644 --- a/src/platform/platform_interface.h +++ b/src/platform/platform_interface.h | |||
@@ -26,6 +26,10 @@ | |||
26 | #ifndef MHD_PLATFORM_INTERFACE_H | 26 | #ifndef MHD_PLATFORM_INTERFACE_H |
27 | #define MHD_PLATFORM_INTERFACE_H | 27 | #define MHD_PLATFORM_INTERFACE_H |
28 | 28 | ||
29 | #if defined(_WIN32) && !defined(__CYGWIN__) | ||
30 | #include "w32functions.h" | ||
31 | #endif | ||
32 | |||
29 | /* MHD_socket_close_(fd) close any FDs (non-W32) / close only socket FDs (W32) */ | 33 | /* MHD_socket_close_(fd) close any FDs (non-W32) / close only socket FDs (W32) */ |
30 | #if !defined(_WIN32) || defined(__CYGWIN__) | 34 | #if !defined(_WIN32) || defined(__CYGWIN__) |
31 | #define MHD_socket_close_(fd) close((fd)) | 35 | #define MHD_socket_close_(fd) close((fd)) |
@@ -33,4 +37,33 @@ | |||
33 | #define MHD_socket_close_(fd) closesocket((fd)) | 37 | #define MHD_socket_close_(fd) closesocket((fd)) |
34 | #endif | 38 | #endif |
35 | 39 | ||
40 | /* MHD_socket_errno_ is errno of last function (non-W32) / errno of last socket function (W32) */ | ||
41 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
42 | #define MHD_socket_errno_ errno | ||
43 | #else | ||
44 | #define MHD_socket_errno_ MHD_W32_errno_from_winsock_() | ||
45 | #endif | ||
46 | |||
47 | /* MHD_socket_last_strerr_ is description string of last errno (non-W32) / | ||
48 | * description string of last socket error (W32) */ | ||
49 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
50 | #define MHD_socket_last_strerr_() strerror(errno) | ||
51 | #else | ||
52 | #define MHD_socket_last_strerr_() MHD_W32_strerror_last_winsock_() | ||
53 | #endif | ||
54 | |||
55 | /* MHD_strerror_ is strerror (both non-W32/W32) */ | ||
56 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
57 | #define MHD_strerror_(errnum) strerror((errnum)) | ||
58 | #else | ||
59 | #define MHD_strerror_(errnum) MHD_W32_strerror_((errnum)) | ||
60 | #endif | ||
61 | |||
62 | /* MHD_set_socket_errno_ set errno to errnum (non-W32) / set socket last error to errnum (W32) */ | ||
63 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
64 | #define MHD_set_socket_errno_(errnum) errno=(errnum) | ||
65 | #else | ||
66 | #define MHD_set_socket_errno_(errnum) MHD_W32_set_last_winsock_error_((errnum)) | ||
67 | #endif | ||
68 | |||
36 | #endif // MHD_PLATFORM_INTERFACE_H | 69 | #endif // MHD_PLATFORM_INTERFACE_H |