]> granicus.if.org Git - curl/commitdiff
BSD-style lwIP TCP/IP stack support - followup
authorYang Tse <yangsita@gmail.com>
Fri, 5 Aug 2011 13:42:05 +0000 (15:42 +0200)
committerYang Tse <yangsita@gmail.com>
Fri, 5 Aug 2011 13:53:00 +0000 (15:53 +0200)
include/curl/curl.h
lib/config-win32.h
lib/connect.c
lib/setup_once.h

index b4330a8bef800ce819d8b0032d1a846512c9a5b1..c3191872817ebc069dfbf726b4e04732ba65de20 100644 (file)
 #include <sys/socket.h>
 #endif
 
-#if defined(__LWIP_OPT_H__)
-#include <lwip/sockets.h>
-#endif
-
 #if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
 #include <sys/time.h>
 #endif
@@ -124,7 +120,7 @@ typedef void CURL;
 
 #ifndef curl_socket_typedef
 /* socket typedef */
-#ifdef WIN32
+#if defined(WIN32) && !defined(__LWIP_OPT_H__)
 typedef SOCKET curl_socket_t;
 #define CURL_SOCKET_BAD INVALID_SOCKET
 #else
index 8c471974506ad0686ddfb9a512b5e1da3b4840d8..1179b15887d66601671ab6ed0f57c80b74e89ccd 100644 (file)
 /*               BSD-style lwIP TCP/IP stack SPECIFIC               */
 /* ---------------------------------------------------------------- */
 
-/* Define this to use BSD-style lwIP TCP/IP stack  */
+/* Define this to use BSD-style lwIP TCP/IP stack */
 /* #define USE_LWIPSOCK 1 */
 
 #ifdef USE_LWIPSOCK
index 1f802bda84c85763b705e284a3a8db4490d765a7..9301f0108b5fd90385dd2931c1f8345532a57175 100644 (file)
@@ -792,7 +792,7 @@ static void nosigpipe(struct connectdata *conn,
 #define nosigpipe(x,y)
 #endif
 
-#ifdef WIN32
+#ifdef USE_WINSOCK
 /* When you run a program that uses the Windows Sockets API, you may
    experience slow performance when you copy data to a TCP server.
 
index 751102bed0fe83ca4e7b40d85e3b2a2aab57562d..4f7d0d79144547afe47e6223f42eabb104ed7fd1 100644 (file)
@@ -490,5 +490,21 @@ typedef int sig_atomic_t;
 
 #define ZERO_NULL 0
 
+
+/*
+ * Ensure that Winsock and lwIP TCP/IP stacks are not mixed.
+ */
+
+#if defined(__LWIP_OPT_H__)
+#  if defined(SOCKET) || \
+     defined(USE_WINSOCK) || \
+     defined(HAVE_ERRNO_H) || \
+     defined(HAVE_WINSOCK_H) || \
+     defined(HAVE_WINSOCK2_H) || \
+     defined(HAVE_WS2TCPIP_H)
+#    error "Winsock and lwIP TCP/IP stack definitions shall not coexist!"
+#  endif
+#endif
+
 #endif /* __SETUP_ONCE_H */