[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r32420 - in libmicrohttpd: . src src/include src/microhttpd
From: |
gnunet |
Subject: |
[GNUnet-SVN] r32420 - in libmicrohttpd: . src src/include src/microhttpd src/platform src/testcurl |
Date: |
Wed, 19 Feb 2014 07:47:35 +0100 |
Author: grothoff
Date: 2014-02-19 07:47:35 +0100 (Wed, 19 Feb 2014)
New Revision: 32420
Added:
libmicrohttpd/src/include/platform_interface.h
libmicrohttpd/src/include/w32functions.h
libmicrohttpd/src/platform/Makefile.am
Removed:
libmicrohttpd/src/platform/platform_interface.h
libmicrohttpd/src/platform/w32functions.h
Modified:
libmicrohttpd/configure.ac
libmicrohttpd/src/Makefile.am
libmicrohttpd/src/include/Makefile.am
libmicrohttpd/src/microhttpd/Makefile.am
libmicrohttpd/src/testcurl/Makefile.am
Log:
move headers to src/include, build w32functions.c as static library (untested)
to make 'make distclean' work cleanly
Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac 2014-02-19 06:45:03 UTC (rev 32419)
+++ libmicrohttpd/configure.ac 2014-02-19 06:47:35 UTC (rev 32420)
@@ -223,7 +223,7 @@
AC_CHECK_HEADERS([search.h], AM_CONDITIONAL(HAVE_TSEARCH, true),
AM_CONDITIONAL(HAVE_TSEARCH, false))
-# Check for pipe/socketpair signaling
+# Check for pipe/socketpair signaling
AC_MSG_CHECKING([[whether to disable pipes signaling]])
AC_ARG_ENABLE([[pipes]],
[AS_HELP_STRING([[--disable-pipes]], [[disable internal singalling by
pipes and use socket pair instead]])],
@@ -231,7 +231,7 @@
AS_IF([[test "x$os_is_windows" = "xyes"]], [disable_pipes=yes
AC_MSG_RESULT([[yes, forced on W32]])],
[[test "x$enable_pipes" != "xno"]], [disable_pipes=no
- AC_MSG_RESULT([[$disable_pipes]])],
+ AC_MSG_RESULT([[$disable_pipes]])],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -242,8 +242,8 @@
]],[[
int sv[2];
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)
!= 0) return 1
-
- ]])],
+
+ ]])],
[disable_pipes=yes
AC_MSG_RESULT([[yes, socketpair in available]])],
[disable_pipes=no
@@ -623,6 +623,7 @@
m4/Makefile
src/Makefile
src/include/Makefile
+src/platform/Makefile
src/microhttpd/Makefile
src/microspdy/Makefile
src/spdy2http/Makefile
Modified: libmicrohttpd/src/Makefile.am
===================================================================
--- libmicrohttpd/src/Makefile.am 2014-02-19 06:45:03 UTC (rev 32419)
+++ libmicrohttpd/src/Makefile.am 2014-02-19 06:47:35 UTC (rev 32420)
@@ -18,7 +18,7 @@
endif
endif
-SUBDIRS = include microhttpd $(microspdy) examples $(curltests) $(zzuftests) .
+SUBDIRS = include platform microhttpd $(microspdy) examples $(curltests)
$(zzuftests) .
EXTRA_DIST = \
datadir/cert-and-key.pem \
Modified: libmicrohttpd/src/include/Makefile.am
===================================================================
--- libmicrohttpd/src/include/Makefile.am 2014-02-19 06:45:03 UTC (rev
32419)
+++ libmicrohttpd/src/include/Makefile.am 2014-02-19 06:47:35 UTC (rev
32420)
@@ -6,4 +6,4 @@
include_HEADERS = microhttpd.h $(microspdy)
-EXTRA_DIST = platform.h
+EXTRA_DIST = platform.h platform_interface.h w32functions.h
Copied: libmicrohttpd/src/include/platform_interface.h (from rev 32417,
libmicrohttpd/src/platform/platform_interface.h)
===================================================================
--- libmicrohttpd/src/include/platform_interface.h
(rev 0)
+++ libmicrohttpd/src/include/platform_interface.h 2014-02-19 06:47:35 UTC
(rev 32420)
@@ -0,0 +1,142 @@
+/*
+ This file is part of libmicrohttpd
+ (C) 2014 Karlson2k (Evgeny Grin)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library.
+ If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file platform/platfrom_interface.h
+ * @brief internal platform abstraction functions
+ * @author Karlson2k (Evgeny Grin)
+ */
+
+#ifndef MHD_PLATFORM_INTERFACE_H
+#define MHD_PLATFORM_INTERFACE_H
+
+#include "platform.h"
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "w32functions.h"
+#endif
+
+/* MHD_socket_close_(fd) close any FDs (non-W32) / close only socket FDs (W32)
*/
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define MHD_socket_close_(fd) close((fd))
+#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(_WIN32) || defined(__CYGWIN__)
+#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(_WIN32) || defined(__CYGWIN__)
+#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(_WIN32) || defined(__CYGWIN__)
+#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(_WIN32) || defined(__CYGWIN__)
+#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) select((int)0,(r),(w),(e),(t))
+#endif
+
+/* MHD_pipe_ create pipe (!MHD_DONT_USE_PIPES) /
+ * create two connected sockets (MHD_DONT_USE_PIPES) */
+#ifndef MHD_DONT_USE_PIPES
+#define MHD_pipe_(fdarr) pipe((fdarr))
+#else /* MHD_DONT_USE_PIPES */
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define MHD_pipe_(fdarr) socketpair(AF_LOCAL, SOCK_STREAM, 0, (fdarr))
+#else /* !defined(_WIN32) || defined(__CYGWIN__) */
+#define MHD_pipe_(fdarr) MHD_W32_pair_of_sockets_((fdarr))
+#endif /* !defined(_WIN32) || defined(__CYGWIN__) */
+#endif /* MHD_DONT_USE_PIPES */
+
+/* MHD_pipe_errno_ is errno of last function (!MHD_DONT_USE_PIPES) /
+ * errno of last emulated pipe function
(MHD_DONT_USE_PIPES) */
+#ifndef MHD_DONT_USE_PIPES
+#define MHD_pipe_errno_ errno
+#else
+#define MHD_pipe_errno_ MHD_socket_errno_
+#endif
+
+/* MHD_pipe_last_strerror_ is description string of last errno
(!MHD_DONT_USE_PIPES) /
+ * description string of last pipe error
(MHD_DONT_USE_PIPES) */
+#ifndef MHD_DONT_USE_PIPES
+#define MHD_pipe_last_strerror_() strerror(errno)
+#else
+#define MHD_pipe_last_strerror_() MHD_socket_last_strerr_()
+#endif
+
+/* MHD_pipe_write_ write data to real pipe (!MHD_DONT_USE_PIPES) /
+ * write data to emulated pipe (MHD_DONT_USE_PIPES) */
+#ifndef MHD_DONT_USE_PIPES
+#define MHD_pipe_write_(fd, ptr, sz) write((fd), (const void*)(ptr), (sz))
+#else
+#define MHD_pipe_write_(fd, ptr, sz) send((fd), (const char*)(ptr), (sz), 0)
+#endif
+
+/* MHD_pipe_read_ read data from real pipe (!MHD_DONT_USE_PIPES) /
+ * read data from emulated pipe (MHD_DONT_USE_PIPES) */
+#ifndef MHD_DONT_USE_PIPES
+#define MHD_pipe_read_(fd, ptr, sz) read((fd), (void*)(ptr), (sz))
+#else
+#define MHD_pipe_read_(fd, ptr, sz) recv((fd), (char*)(ptr), (sz), 0)
+#endif
+
+/* MHD_pipe_close_(fd) close any FDs (non-W32) /
+ * close emulated pipe FDs (W32) */
+#ifndef MHD_DONT_USE_PIPES
+#define MHD_pipe_close_(fd) close((fd))
+#else
+#define MHD_pipe_close_(fd) MHD_socket_close_((fd))
+#endif
+
+/* MHD_INVALID_PIPE_ is a value of bad pipe FD */
+#ifndef MHD_DONT_USE_PIPES
+#define MHD_INVALID_PIPE_ (-1)
+#else
+#define MHD_INVALID_PIPE_ MHD_INVALID_SOCKET
+#endif
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define MHD_random_() random()
+#else
+#define MHD_random_() MHD_W32_random()
+#endif
+
+#endif // MHD_PLATFORM_INTERFACE_H
Copied: libmicrohttpd/src/include/w32functions.h (from rev 32417,
libmicrohttpd/src/platform/w32functions.h)
===================================================================
--- libmicrohttpd/src/include/w32functions.h (rev 0)
+++ libmicrohttpd/src/include/w32functions.h 2014-02-19 06:47:35 UTC (rev
32420)
@@ -0,0 +1,191 @@
+/*
+ This file is part of libmicrohttpd
+ (C) 2014 Karlson2k (Evgeny Grin)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library.
+ If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file platform/w32functions.h
+ * @brief internal functions for W32 systems
+ * @author Karlson2k (Evgeny Grin)
+ */
+
+#ifndef MHD_W32FUNCTIONS_H
+#define MHD_W32FUNCTIONS_H
+#ifndef _WIN32
+#error w32functions.h is designed only for W32 systems
+#endif
+
+#include <errno.h>
+#include <winsock2.h>
+#include "platform.h"
+#include "platform_interface.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define MHDW32ERRBASE 3300
+
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK (MHDW32ERRBASE+1)
+#endif
+#ifndef EINPROGRESS
+#define EINPROGRESS (MHDW32ERRBASE+2)
+#endif
+#ifndef EALREADY
+#define EALREADY (MHDW32ERRBASE+3)
+#endif
+#ifndef ENOTSOCK
+#define ENOTSOCK (MHDW32ERRBASE+4)
+#endif
+#ifndef EDESTADDRREQ
+#define EDESTADDRREQ (MHDW32ERRBASE+5)
+#endif
+#ifndef EMSGSIZE
+#define EMSGSIZE (MHDW32ERRBASE+6)
+#endif
+#ifndef EPROTOTYPE
+#define EPROTOTYPE (MHDW32ERRBASE+7)
+#endif
+#ifndef ENOPROTOOPT
+#define ENOPROTOOPT (MHDW32ERRBASE+8)
+#endif
+#ifndef EPROTONOSUPPORT
+#define EPROTONOSUPPORT (MHDW32ERRBASE+9)
+#endif
+#ifndef EOPNOTSUPP
+#define EOPNOTSUPP (MHDW32ERRBASE+10)
+#endif
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT (MHDW32ERRBASE+11)
+#endif
+#ifndef EADDRINUSE
+#define EADDRINUSE (MHDW32ERRBASE+12)
+#endif
+#ifndef EADDRNOTAVAIL
+#define EADDRNOTAVAIL (MHDW32ERRBASE+13)
+#endif
+#ifndef ENETDOWN
+#define ENETDOWN (MHDW32ERRBASE+14)
+#endif
+#ifndef ENETUNREACH
+#define ENETUNREACH (MHDW32ERRBASE+15)
+#endif
+#ifndef ENETRESET
+#define ENETRESET (MHDW32ERRBASE+16)
+#endif
+#ifndef ECONNABORTED
+#define ECONNABORTED (MHDW32ERRBASE+17)
+#endif
+#ifndef ECONNRESET
+#define ECONNRESET (MHDW32ERRBASE+18)
+#endif
+#ifndef ENOBUFS
+#define ENOBUFS (MHDW32ERRBASE+19)
+#endif
+#ifndef EISCONN
+#define EISCONN (MHDW32ERRBASE+20)
+#endif
+#ifndef ENOTCONN
+#define ENOTCONN (MHDW32ERRBASE+21)
+#endif
+#ifndef ETOOMANYREFS
+#define ETOOMANYREFS (MHDW32ERRBASE+22)
+#endif
+#ifndef ECONNREFUSED
+#define ECONNREFUSED (MHDW32ERRBASE+23)
+#endif
+#ifndef ELOOP
+#define ELOOP (MHDW32ERRBASE+24)
+#endif
+#ifndef EHOSTDOWN
+#define EHOSTDOWN (MHDW32ERRBASE+25)
+#endif
+#ifndef EHOSTUNREACH
+#define EHOSTUNREACH (MHDW32ERRBASE+26)
+#endif
+#ifndef EPROCLIM
+#define EPROCLIM (MHDW32ERRBASE+27)
+#endif
+#ifndef EUSERS
+#define EUSERS (MHDW32ERRBASE+28)
+#endif
+#ifndef EDQUOT
+#define EDQUOT (MHDW32ERRBASE+29)
+#endif
+#ifndef ESTALE
+#define ESTALE (MHDW32ERRBASE+30)
+#endif
+#ifndef EREMOTE
+#define EREMOTE (MHDW32ERRBASE+31)
+#endif
+#ifndef ESOCKTNOSUPPORT
+#define ESOCKTNOSUPPORT (MHDW32ERRBASE+32)
+#endif
+#ifndef EPFNOSUPPORT
+#define EPFNOSUPPORT (MHDW32ERRBASE+33)
+#endif
+#ifndef ESHUTDOWN
+#define ESHUTDOWN (MHDW32ERRBASE+34)
+#endif
+#ifndef ENODATA
+#define ENODATA (MHDW32ERRBASE+35)
+#endif
+
+/**
+ * Return errno equivalent of last winsock error
+ * @return errno equivalent of last winsock error
+ */
+int MHD_W32_errno_from_winsock_(void);
+/**
+ * Return pointer to string description of errnum error
+ * Works fine with both standard errno errnums
+ * and errnums from MHD_W32_errno_from_winsock_
+ * @param errnum the errno or value from MHD_W32_errno_from_winsock_()
+ * @return pointer to string description of error
+ */
+const char* MHD_W32_strerror_(int errnum);
+/**
+ * Return pointer to string description of last winsock error
+ * @return pointer to string description of last winsock error
+ */
+const char* MHD_W32_strerror_last_winsock_(void);
+/**
+ * Set last winsock error to equivalent of given errno value
+ * @param errnum the errno value to set
+ */
+void MHD_W32_set_last_winsock_error_(int errnum);
+
+/**
+ * Create pair of mutually connected TCP/IP sockets on loopback address
+ * @param sockets_pair array to receive resulted sockets
+ * @return zero on success, -1 otherwise
+ */
+int MHD_W32_pair_of_sockets_(SOCKET sockets_pair[2]);
+/**
+ * Generate 31-bit pseudo random number.
+ * Function initialize itself at first call to current time.
+ * @return 31-bit pseudo random number.
+ */
+_MHD_EXTERN int MHD_W32_random(void); /* must be exported for "make check"
tests */
+ /* TODO: exclude from exports */
+
+#ifdef __cplusplus
+}
+#endif
+#endif //MHD_W32FUNCTIONS_H
Modified: libmicrohttpd/src/microhttpd/Makefile.am
===================================================================
--- libmicrohttpd/src/microhttpd/Makefile.am 2014-02-19 06:45:03 UTC (rev
32419)
+++ libmicrohttpd/src/microhttpd/Makefile.am 2014-02-19 06:47:35 UTC (rev
32420)
@@ -1,11 +1,6 @@
-if HAVE_W32
- W32FUNC_SRC = ../platform/w32functions.c ../platform/w32functions.h
-endif
-
AM_CPPFLAGS = \
-I$(top_srcdir)/src/include \
- -I$(top_srcdir)/src/microhttpd \
- -I$(top_srcdir)/src/platform
+ -I$(top_srcdir)/src/microhttpd
AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS) \
@LIBGCRYPT_CFLAGS@
@@ -21,13 +16,19 @@
internal.c internal.h \
memorypool.c memorypool.h \
response.c response.h \
- ../platform/platform_interface.h $(W32FUNC_SRC)
libmicrohttpd_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DBUILDING_MHD_LIB=1
+libmicrohttpd_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ -DBUILDING_MHD_LIB=1
libmicrohttpd_la_LDFLAGS = \
$(MHD_LIB_LDFLAGS) \
-version-info @LIB_VERSION_CURRENT@:@LIB_VERSION_REVISION@:@LIB_VERSION_AGE@
+if HAVE_W32
+libmicrohttpd_LDADD =
+ $(top_builddir)/src/platform/libmicrohttpd_w32.la
+endif
if USE_COVERAGE
AM_CFLAGS += --coverage
Added: libmicrohttpd/src/platform/Makefile.am
===================================================================
--- libmicrohttpd/src/platform/Makefile.am (rev 0)
+++ libmicrohttpd/src/platform/Makefile.am 2014-02-19 06:47:35 UTC (rev
32420)
@@ -0,0 +1,21 @@
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/src/include \
+ -I$(top_srcdir)/src/microhttpd
+
+AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS) \
+ @LIBGCRYPT_CFLAGS@
+
+if USE_COVERAGE
+ AM_CFLAGS += --coverage
+endif
+
+if HAVE_W32
+lib_LIBRARIES = \
+ libmicrohttpd_w32.a
+libmicrohttpd_w32_a_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DBUILDING_MHD_LIB=1
+libmicrohttpd_w32_a_SOURCES = \
+ w32functions.c
+endif
+
Deleted: libmicrohttpd/src/platform/platform_interface.h
===================================================================
--- libmicrohttpd/src/platform/platform_interface.h 2014-02-19 06:45:03 UTC
(rev 32419)
+++ libmicrohttpd/src/platform/platform_interface.h 2014-02-19 06:47:35 UTC
(rev 32420)
@@ -1,142 +0,0 @@
-/*
- This file is part of libmicrohttpd
- (C) 2014 Karlson2k (Evgeny Grin)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library.
- If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @file platform/platfrom_interface.h
- * @brief internal platform abstraction functions
- * @author Karlson2k (Evgeny Grin)
- */
-
-#ifndef MHD_PLATFORM_INTERFACE_H
-#define MHD_PLATFORM_INTERFACE_H
-
-#include "platform.h"
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#include "w32functions.h"
-#endif
-
-/* MHD_socket_close_(fd) close any FDs (non-W32) / close only socket FDs (W32)
*/
-#if !defined(_WIN32) || defined(__CYGWIN__)
-#define MHD_socket_close_(fd) close((fd))
-#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(_WIN32) || defined(__CYGWIN__)
-#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(_WIN32) || defined(__CYGWIN__)
-#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(_WIN32) || defined(__CYGWIN__)
-#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(_WIN32) || defined(__CYGWIN__)
-#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) select((int)0,(r),(w),(e),(t))
-#endif
-
-/* MHD_pipe_ create pipe (!MHD_DONT_USE_PIPES) /
- * create two connected sockets (MHD_DONT_USE_PIPES) */
-#ifndef MHD_DONT_USE_PIPES
-#define MHD_pipe_(fdarr) pipe((fdarr))
-#else /* MHD_DONT_USE_PIPES */
-#if !defined(_WIN32) || defined(__CYGWIN__)
-#define MHD_pipe_(fdarr) socketpair(AF_LOCAL, SOCK_STREAM, 0, (fdarr))
-#else /* !defined(_WIN32) || defined(__CYGWIN__) */
-#define MHD_pipe_(fdarr) MHD_W32_pair_of_sockets_((fdarr))
-#endif /* !defined(_WIN32) || defined(__CYGWIN__) */
-#endif /* MHD_DONT_USE_PIPES */
-
-/* MHD_pipe_errno_ is errno of last function (!MHD_DONT_USE_PIPES) /
- * errno of last emulated pipe function
(MHD_DONT_USE_PIPES) */
-#ifndef MHD_DONT_USE_PIPES
-#define MHD_pipe_errno_ errno
-#else
-#define MHD_pipe_errno_ MHD_socket_errno_
-#endif
-
-/* MHD_pipe_last_strerror_ is description string of last errno
(!MHD_DONT_USE_PIPES) /
- * description string of last pipe error
(MHD_DONT_USE_PIPES) */
-#ifndef MHD_DONT_USE_PIPES
-#define MHD_pipe_last_strerror_() strerror(errno)
-#else
-#define MHD_pipe_last_strerror_() MHD_socket_last_strerr_()
-#endif
-
-/* MHD_pipe_write_ write data to real pipe (!MHD_DONT_USE_PIPES) /
- * write data to emulated pipe (MHD_DONT_USE_PIPES) */
-#ifndef MHD_DONT_USE_PIPES
-#define MHD_pipe_write_(fd, ptr, sz) write((fd), (const void*)(ptr), (sz))
-#else
-#define MHD_pipe_write_(fd, ptr, sz) send((fd), (const char*)(ptr), (sz), 0)
-#endif
-
-/* MHD_pipe_read_ read data from real pipe (!MHD_DONT_USE_PIPES) /
- * read data from emulated pipe (MHD_DONT_USE_PIPES) */
-#ifndef MHD_DONT_USE_PIPES
-#define MHD_pipe_read_(fd, ptr, sz) read((fd), (void*)(ptr), (sz))
-#else
-#define MHD_pipe_read_(fd, ptr, sz) recv((fd), (char*)(ptr), (sz), 0)
-#endif
-
-/* MHD_pipe_close_(fd) close any FDs (non-W32) /
- * close emulated pipe FDs (W32) */
-#ifndef MHD_DONT_USE_PIPES
-#define MHD_pipe_close_(fd) close((fd))
-#else
-#define MHD_pipe_close_(fd) MHD_socket_close_((fd))
-#endif
-
-/* MHD_INVALID_PIPE_ is a value of bad pipe FD */
-#ifndef MHD_DONT_USE_PIPES
-#define MHD_INVALID_PIPE_ (-1)
-#else
-#define MHD_INVALID_PIPE_ MHD_INVALID_SOCKET
-#endif
-
-#if !defined(_WIN32) || defined(__CYGWIN__)
-#define MHD_random_() random()
-#else
-#define MHD_random_() MHD_W32_random()
-#endif
-
-#endif // MHD_PLATFORM_INTERFACE_H
Deleted: libmicrohttpd/src/platform/w32functions.h
===================================================================
--- libmicrohttpd/src/platform/w32functions.h 2014-02-19 06:45:03 UTC (rev
32419)
+++ libmicrohttpd/src/platform/w32functions.h 2014-02-19 06:47:35 UTC (rev
32420)
@@ -1,191 +0,0 @@
-/*
- This file is part of libmicrohttpd
- (C) 2014 Karlson2k (Evgeny Grin)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library.
- If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @file platform/w32functions.h
- * @brief internal functions for W32 systems
- * @author Karlson2k (Evgeny Grin)
- */
-
-#ifndef MHD_W32FUNCTIONS_H
-#define MHD_W32FUNCTIONS_H
-#ifndef _WIN32
-#error w32functions.h is designed only for W32 systems
-#endif
-
-#include <errno.h>
-#include <winsock2.h>
-#include "platform.h"
-#include "platform_interface.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define MHDW32ERRBASE 3300
-
-#ifndef EWOULDBLOCK
-#define EWOULDBLOCK (MHDW32ERRBASE+1)
-#endif
-#ifndef EINPROGRESS
-#define EINPROGRESS (MHDW32ERRBASE+2)
-#endif
-#ifndef EALREADY
-#define EALREADY (MHDW32ERRBASE+3)
-#endif
-#ifndef ENOTSOCK
-#define ENOTSOCK (MHDW32ERRBASE+4)
-#endif
-#ifndef EDESTADDRREQ
-#define EDESTADDRREQ (MHDW32ERRBASE+5)
-#endif
-#ifndef EMSGSIZE
-#define EMSGSIZE (MHDW32ERRBASE+6)
-#endif
-#ifndef EPROTOTYPE
-#define EPROTOTYPE (MHDW32ERRBASE+7)
-#endif
-#ifndef ENOPROTOOPT
-#define ENOPROTOOPT (MHDW32ERRBASE+8)
-#endif
-#ifndef EPROTONOSUPPORT
-#define EPROTONOSUPPORT (MHDW32ERRBASE+9)
-#endif
-#ifndef EOPNOTSUPP
-#define EOPNOTSUPP (MHDW32ERRBASE+10)
-#endif
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT (MHDW32ERRBASE+11)
-#endif
-#ifndef EADDRINUSE
-#define EADDRINUSE (MHDW32ERRBASE+12)
-#endif
-#ifndef EADDRNOTAVAIL
-#define EADDRNOTAVAIL (MHDW32ERRBASE+13)
-#endif
-#ifndef ENETDOWN
-#define ENETDOWN (MHDW32ERRBASE+14)
-#endif
-#ifndef ENETUNREACH
-#define ENETUNREACH (MHDW32ERRBASE+15)
-#endif
-#ifndef ENETRESET
-#define ENETRESET (MHDW32ERRBASE+16)
-#endif
-#ifndef ECONNABORTED
-#define ECONNABORTED (MHDW32ERRBASE+17)
-#endif
-#ifndef ECONNRESET
-#define ECONNRESET (MHDW32ERRBASE+18)
-#endif
-#ifndef ENOBUFS
-#define ENOBUFS (MHDW32ERRBASE+19)
-#endif
-#ifndef EISCONN
-#define EISCONN (MHDW32ERRBASE+20)
-#endif
-#ifndef ENOTCONN
-#define ENOTCONN (MHDW32ERRBASE+21)
-#endif
-#ifndef ETOOMANYREFS
-#define ETOOMANYREFS (MHDW32ERRBASE+22)
-#endif
-#ifndef ECONNREFUSED
-#define ECONNREFUSED (MHDW32ERRBASE+23)
-#endif
-#ifndef ELOOP
-#define ELOOP (MHDW32ERRBASE+24)
-#endif
-#ifndef EHOSTDOWN
-#define EHOSTDOWN (MHDW32ERRBASE+25)
-#endif
-#ifndef EHOSTUNREACH
-#define EHOSTUNREACH (MHDW32ERRBASE+26)
-#endif
-#ifndef EPROCLIM
-#define EPROCLIM (MHDW32ERRBASE+27)
-#endif
-#ifndef EUSERS
-#define EUSERS (MHDW32ERRBASE+28)
-#endif
-#ifndef EDQUOT
-#define EDQUOT (MHDW32ERRBASE+29)
-#endif
-#ifndef ESTALE
-#define ESTALE (MHDW32ERRBASE+30)
-#endif
-#ifndef EREMOTE
-#define EREMOTE (MHDW32ERRBASE+31)
-#endif
-#ifndef ESOCKTNOSUPPORT
-#define ESOCKTNOSUPPORT (MHDW32ERRBASE+32)
-#endif
-#ifndef EPFNOSUPPORT
-#define EPFNOSUPPORT (MHDW32ERRBASE+33)
-#endif
-#ifndef ESHUTDOWN
-#define ESHUTDOWN (MHDW32ERRBASE+34)
-#endif
-#ifndef ENODATA
-#define ENODATA (MHDW32ERRBASE+35)
-#endif
-
-/**
- * Return errno equivalent of last winsock error
- * @return errno equivalent of last winsock error
- */
-int MHD_W32_errno_from_winsock_(void);
-/**
- * Return pointer to string description of errnum error
- * Works fine with both standard errno errnums
- * and errnums from MHD_W32_errno_from_winsock_
- * @param errnum the errno or value from MHD_W32_errno_from_winsock_()
- * @return pointer to string description of error
- */
-const char* MHD_W32_strerror_(int errnum);
-/**
- * Return pointer to string description of last winsock error
- * @return pointer to string description of last winsock error
- */
-const char* MHD_W32_strerror_last_winsock_(void);
-/**
- * Set last winsock error to equivalent of given errno value
- * @param errnum the errno value to set
- */
-void MHD_W32_set_last_winsock_error_(int errnum);
-
-/**
- * Create pair of mutually connected TCP/IP sockets on loopback address
- * @param sockets_pair array to receive resulted sockets
- * @return zero on success, -1 otherwise
- */
-int MHD_W32_pair_of_sockets_(SOCKET sockets_pair[2]);
-/**
- * Generate 31-bit pseudo random number.
- * Function initialize itself at first call to current time.
- * @return 31-bit pseudo random number.
- */
-_MHD_EXTERN int MHD_W32_random(void); /* must be exported for "make check"
tests */
- /* TODO: exclude from exports */
-
-#ifdef __cplusplus
-}
-#endif
-#endif //MHD_W32FUNCTIONS_H
Modified: libmicrohttpd/src/testcurl/Makefile.am
===================================================================
--- libmicrohttpd/src/testcurl/Makefile.am 2014-02-19 06:45:03 UTC (rev
32419)
+++ libmicrohttpd/src/testcurl/Makefile.am 2014-02-19 06:47:35 UTC (rev
32420)
@@ -12,7 +12,6 @@
-I$(top_srcdir) \
-I$(top_srcdir)/src/microhttpd \
-I$(top_srcdir)/src/include \
--I$(top_srcdir)/src/platform \
$(LIBCURL_CPPFLAGS)
if !HAVE_W32
@@ -57,7 +56,7 @@
test_post_loop \
test_post11 \
test_postform11 \
- test_post_loop11
+ test_post_loop11
endif
noinst_PROGRAMS = \
@@ -90,33 +89,33 @@
test_get.c
test_get_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_quiesce_SOURCES = \
test_quiesce.c
test_quiesce_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_callback_SOURCES = \
test_callback.c
test_callback_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
perf_get_SOURCES = \
perf_get.c \
gauger.h
perf_get_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
perf_get_concurrent_SOURCES = \
perf_get_concurrent.c \
gauger.h
perf_get_concurrent_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_digestauth_SOURCES = \
test_digestauth.c
@@ -131,56 +130,55 @@
@LIBCURL@ @LIBGCRYPT_LIBS@
test_get_sendfile_SOURCES = \
- test_get_sendfile.c \
- ../platform/platform_interface.h
+ test_get_sendfile.c
+test_get_sendfile_LDADD = \
+ $(top_builddir)/src/microhttpd/libmicrohttpd.la \
+ @LIBCURL@
if HAVE_W32
-test_get_sendfile_SOURCES += \
- ../platform/w32functions.h ../platform/w32functions.c
+test_get_sendfile_LDADD +=
+ $(top_builddir)/src/platform/libmicrohttpd_w32.la
endif
-test_get_sendfile_LDADD = \
- $(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
test_urlparse_SOURCES = \
test_urlparse.c
test_urlparse_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_get_response_cleanup_SOURCES = \
test_get_response_cleanup.c
test_get_response_cleanup_LDADD = \
- $(top_builddir)/src/microhttpd/libmicrohttpd.la
+ $(top_builddir)/src/microhttpd/libmicrohttpd.la
test_get_chunked_SOURCES = \
test_get_chunked.c
test_get_chunked_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_post_SOURCES = \
test_post.c
test_post_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_process_headers_SOURCES = \
test_process_headers.c
test_process_headers_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_parse_cookies_SOURCES = \
test_parse_cookies.c
test_parse_cookies_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_process_arguments_SOURCES = \
test_process_arguments.c
test_process_arguments_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_postform_SOURCES = \
test_postform.c
@@ -192,41 +190,41 @@
test_post_loop.c
test_post_loop_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_put_SOURCES = \
test_put.c
test_put_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_put_chunked_SOURCES = \
test_put_chunked.c
test_put_chunked_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_get11_SOURCES = \
test_get.c
test_get11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_get_sendfile11_SOURCES = \
test_get_sendfile.c
+test_get_sendfile11_LDADD = \
+ $(top_builddir)/src/microhttpd/libmicrohttpd.la \
+ @LIBCURL@
if HAVE_W32
-test_get_sendfile11_SOURCES += \
- ../platform/w32functions.h ../platform/w32functions.c
+test_get_sendfile11_LDADD += \
+ $(top_builddir)/src/platform/libmicrohttpd_w32.la
endif
-test_get_sendfile11_LDADD = \
- $(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
test_post11_SOURCES = \
test_post.c
test_post11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_postform11_SOURCES = \
test_postform.c
@@ -238,53 +236,53 @@
test_post_loop.c
test_post_loop11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_put11_SOURCES = \
test_put.c
test_put11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_large_put_SOURCES = \
test_large_put.c
test_large_put_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_large_put11_SOURCES = \
test_large_put.c
test_large_put11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_long_header_SOURCES = \
test_long_header.c
test_long_header_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_long_header11_SOURCES = \
test_long_header.c
test_long_header11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_iplimit11_SOURCES = \
test_iplimit.c
test_iplimit11_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_termination_SOURCES = \
test_termination.c
test_termination_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
test_timeout_SOURCES = \
test_timeout.c
test_timeout_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
- @LIBCURL@
+ @LIBCURL@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r32420 - in libmicrohttpd: . src src/include src/microhttpd src/platform src/testcurl,
gnunet <=