From a6ed2b8426675115d6d29bfec4d8597cf715b33c Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 4 Aug 2011 21:27:29 +0200 Subject: BSD-style lwIP TCP/IP stack support: Allow compilation of libcurl and curl using BSD-style lwIP on Win32. In order to compile libcurl and curl with this support it is necessary to edit files lib/config-win32.h and src/config-win32.h and uncomment a line to make definition of preprocessor symbol USE_LWIPSOCK visible. Afterwards you can compile as usual. In order to use compiled library with BSD-style lwIP TCP/IP stack in your program it is mandatory that you include lwIP header file before including or Compilation has been verified with lwIP 1.4.0 and contrib-1.4.0 from: http://download.savannah.gnu.org/releases/lwip/lwip-1.4.0.zip http://download.savannah.gnu.org/releases/lwip/contrib-1.4.0.zip Have fun! --- lib/config-win32.h | 25 +++++++++++++++++++++++++ lib/setup.h | 5 +++++ 2 files changed, 30 insertions(+) (limited to 'lib') diff --git a/lib/config-win32.h b/lib/config-win32.h index c4fe1b391..e9219de19 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -388,6 +388,31 @@ /* Define this if you have struct timeval */ #define HAVE_STRUCT_TIMEVAL 1 +/* ---------------------------------------------------------------- */ +/* BSD-style lwIP TCP/IP stack SPECIFIC */ +/* ---------------------------------------------------------------- */ + +/* Define this to use BSD-style lwIP TCP/IP stack */ +/* #define USE_LWIPSOCK 1 */ + +#ifdef USE_LWIPSOCK +# undef USE_WINSOCK +# undef HAVE_WINSOCK_H +# undef HAVE_WINSOCK2_H +# undef HAVE_WS2TCPIP_H +# undef HAVE_ERRNO_H +# undef HAVE_GETHOSTNAME +# undef HAVE_GETNAMEINFO +# undef LWIP_POSIX_SOCKETS_IO_NAMES +# define HAVE_FREEADDRINFO +# define HAVE_GETADDRINFO +# define HAVE_GETHOSTBYNAME +# define HAVE_GETHOSTBYNAME_R +# define HAVE_GETHOSTBYNAME_R_6 +# define LWIP_POSIX_SOCKETS_IO_NAMES 0 +# define SOCKET int +#endif + /* ---------------------------------------------------------------- */ /* Watt-32 tcp/ip SPECIFIC */ /* ---------------------------------------------------------------- */ diff --git a/lib/setup.h b/lib/setup.h index eb19bafab..d89111f95 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -251,6 +251,11 @@ # endif #endif +#ifdef USE_LWIPSOCK +# include +# include +#endif + #ifdef HAVE_EXTRA_STRICMP_H # include #endif -- cgit v1.2.3