summaryrefslogtreecommitdiff
path: root/src/include/platform_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/platform_interface.h')
-rw-r--r--src/include/platform_interface.h80
1 files changed, 1 insertions, 79 deletions
diff --git a/src/include/platform_interface.h b/src/include/platform_interface.h
index c2aee64b..fa84bcd5 100644
--- a/src/include/platform_interface.h
+++ b/src/include/platform_interface.h
@@ -27,6 +27,7 @@
#define MHD_PLATFORM_INTERFACE_H
#include "platform.h"
+#include "../microhttpd/mhd_sockets.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "w32functions.h"
#endif
@@ -46,85 +47,6 @@
#endif /* ! _WIN32*/
#endif /* ! HAVE_SNPRINTF */
-
-/**
- * _MHD_socket_funcs_size is type used to specify size for send and recv
- * functions
- */
-#if !defined(MHD_WINSOCK_SOCKETS)
-typedef size_t _MHD_socket_funcs_size;
-#else
-typedef int _MHD_socket_funcs_size;
-#endif
-
-/**
- * MHD_socket_close_(fd) close any FDs (non-W32) / close only socket
- * FDs (W32). Note that on HP-UNIX, this function may leak the FD if
- * errno is set to EINTR. Do not use HP-UNIX.
- *
- * @param fd descriptor to close
- * @return 0 on success (error codes like EINTR and EIO are counted as success,
- * only EBADF counts as an error!)
- */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#define MHD_socket_close_(fd) (((0 != close(fd)) && (EBADF == errno)) ? -1 : 0)
-#else
-#define MHD_socket_close_(fd) closesocket((fd))
-#endif
-
-/**
- * MHD_socket_errno_ is errno of last function (non-W32) / errno of
- * last socket function (W32)
- */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#define MHD_socket_errno_ errno
-#else
-#define MHD_socket_errno_ MHD_W32_errno_from_winsock_()
-#endif
-
-/* MHD_socket_last_strerr_ is description string of last errno (non-W32) /
- * description string of last socket error (W32) */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#define MHD_socket_last_strerr_() strerror(errno)
-#else
-#define MHD_socket_last_strerr_() MHD_W32_strerror_last_winsock_()
-#endif
-
-/* MHD_strerror_ is strerror (both non-W32/W32) */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#define MHD_strerror_(errnum) strerror((errnum))
-#else
-#define MHD_strerror_(errnum) MHD_W32_strerror_((errnum))
-#endif
-
-/* MHD_set_socket_errno_ set errno to errnum (non-W32) / set socket last error to errnum (W32) */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#define MHD_set_socket_errno_(errnum) errno=(errnum)
-#else
-#define MHD_set_socket_errno_(errnum) MHD_W32_set_last_winsock_error_((errnum))
-#endif
-
-/* MHD_SYS_select_ is wrapper macro for system select() function */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#define MHD_SYS_select_(n,r,w,e,t) select((n),(r),(w),(e),(t))
-#else
-#define MHD_SYS_select_(n,r,w,e,t) \
- ( (!(r) || ((fd_set*)(r))->fd_count == 0) && \
- (!(w) || ((fd_set*)(w))->fd_count == 0) && \
- (!(e) || ((fd_set*)(e))->fd_count == 0) ) ? \
- ( (t) ? (Sleep((t)->tv_sec * 1000 + (t)->tv_usec / 1000), 0) : 0 ) : \
- (select((int)0,(r),(w),(e),(t)))
-#endif
-
-#if defined(HAVE_POLL)
-/* MHD_sys_poll_ is wrapper macro for system poll() function */
-#if !defined(MHD_WINSOCK_SOCKETS)
-#define MHD_sys_poll_ poll
-#else /* MHD_WINSOCK_SOCKETS */
-#define MHD_sys_poll_ WSAPoll
-#endif /* MHD_WINSOCK_SOCKETS */
-#endif /* HAVE_POLL */
-
/* MHD_pipe_ create pipe (!MHD_DONT_USE_PIPES) /
* create two connected sockets (MHD_DONT_USE_PIPES) */
#ifndef MHD_DONT_USE_PIPES