diff options
Diffstat (limited to 'src/include/platform_interface.h')
-rw-r--r-- | src/include/platform_interface.h | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/src/include/platform_interface.h b/src/include/platform_interface.h index fa84bcd5..b641a002 100644 --- a/src/include/platform_interface.h +++ b/src/include/platform_interface.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #define MHD_PLATFORM_INTERFACE_H | 27 | #define MHD_PLATFORM_INTERFACE_H |
28 | 28 | ||
29 | #include "platform.h" | 29 | #include "platform.h" |
30 | #include "../microhttpd/mhd_sockets.h" | ||
31 | #if defined(_WIN32) && !defined(__CYGWIN__) | 30 | #if defined(_WIN32) && !defined(__CYGWIN__) |
32 | #include "w32functions.h" | 31 | #include "w32functions.h" |
33 | #endif | 32 | #endif |
@@ -47,65 +46,6 @@ | |||
47 | #endif /* ! _WIN32*/ | 46 | #endif /* ! _WIN32*/ |
48 | #endif /* ! HAVE_SNPRINTF */ | 47 | #endif /* ! HAVE_SNPRINTF */ |
49 | 48 | ||
50 | /* MHD_pipe_ create pipe (!MHD_DONT_USE_PIPES) / | ||
51 | * create two connected sockets (MHD_DONT_USE_PIPES) */ | ||
52 | #ifndef MHD_DONT_USE_PIPES | ||
53 | #define MHD_pipe_(fdarr) pipe((fdarr)) | ||
54 | #else /* MHD_DONT_USE_PIPES */ | ||
55 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
56 | #define MHD_pipe_(fdarr) socketpair(AF_LOCAL, SOCK_STREAM, 0, (fdarr)) | ||
57 | #else /* !defined(_WIN32) || defined(__CYGWIN__) */ | ||
58 | #define MHD_pipe_(fdarr) MHD_W32_pair_of_sockets_((fdarr)) | ||
59 | #endif /* !defined(_WIN32) || defined(__CYGWIN__) */ | ||
60 | #endif /* MHD_DONT_USE_PIPES */ | ||
61 | |||
62 | /* MHD_pipe_errno_ is errno of last function (!MHD_DONT_USE_PIPES) / | ||
63 | * errno of last emulated pipe function (MHD_DONT_USE_PIPES) */ | ||
64 | #ifndef MHD_DONT_USE_PIPES | ||
65 | #define MHD_pipe_errno_ errno | ||
66 | #else | ||
67 | #define MHD_pipe_errno_ MHD_socket_errno_ | ||
68 | #endif | ||
69 | |||
70 | /* MHD_pipe_last_strerror_ is description string of last errno (!MHD_DONT_USE_PIPES) / | ||
71 | * description string of last pipe error (MHD_DONT_USE_PIPES) */ | ||
72 | #ifndef MHD_DONT_USE_PIPES | ||
73 | #define MHD_pipe_last_strerror_() strerror(errno) | ||
74 | #else | ||
75 | #define MHD_pipe_last_strerror_() MHD_socket_last_strerr_() | ||
76 | #endif | ||
77 | |||
78 | /* MHD_pipe_write_ write data to real pipe (!MHD_DONT_USE_PIPES) / | ||
79 | * write data to emulated pipe (MHD_DONT_USE_PIPES) */ | ||
80 | #ifndef MHD_DONT_USE_PIPES | ||
81 | #define MHD_pipe_write_(fd, ptr, sz) write((fd), (const void*)(ptr), (sz)) | ||
82 | #else | ||
83 | #define MHD_pipe_write_(fd, ptr, sz) send((fd), (const char*)(ptr), (sz), 0) | ||
84 | #endif | ||
85 | |||
86 | /* MHD_pipe_drain_ drain data from real pipe (!MHD_DONT_USE_PIPES) / | ||
87 | * drain data from emulated pipe (MHD_DONT_USE_PIPES) */ | ||
88 | #ifndef MHD_DONT_USE_PIPES | ||
89 | #define MHD_pipe_drain_(fd) do { long tmp; while (0 < read((fd), (void*)&tmp, sizeof (tmp))) ; } while (0) | ||
90 | #else | ||
91 | #define MHD_pipe_drain_(fd) do { long tmp; while (0 < recv((fd), (void*)&tmp, sizeof (tmp), 0)) ; } while (0) | ||
92 | #endif | ||
93 | |||
94 | /* MHD_pipe_close_(fd) close any FDs (non-W32) / | ||
95 | * close emulated pipe FDs (W32) */ | ||
96 | #ifndef MHD_DONT_USE_PIPES | ||
97 | #define MHD_pipe_close_(fd) close((fd)) | ||
98 | #else | ||
99 | #define MHD_pipe_close_(fd) MHD_socket_close_((fd)) | ||
100 | #endif | ||
101 | |||
102 | /* MHD_INVALID_PIPE_ is a value of bad pipe FD */ | ||
103 | #ifndef MHD_DONT_USE_PIPES | ||
104 | #define MHD_INVALID_PIPE_ (-1) | ||
105 | #else | ||
106 | #define MHD_INVALID_PIPE_ MHD_INVALID_SOCKET | ||
107 | #endif | ||
108 | |||
109 | #if !defined(_WIN32) || defined(__CYGWIN__) | 49 | #if !defined(_WIN32) || defined(__CYGWIN__) |
110 | #define MHD_random_() random() | 50 | #define MHD_random_() random() |
111 | #else | 51 | #else |