cURL / Mailing Lists / curl-library / Single Mail

curl-library

Using libcurl on top of lwip on POSIX embedded platform

From: Mason <mpeg.blue_at_free.fr>
Date: Thu, 08 Mar 2012 17:48:41 +0100

Hello,

I've been making some progress porting libcurl on top of lwip
(light-weight TCP/IP stack) on my sh-superh-elf platform.

( https://savannah.nongnu.org/projects/lwip )

The configure script now runs correctly, generating all the
Makefiles and the custom headers.

However, compiling fails for a simple reason:

In file included from file.c:23:0:
setup.h:630:6: error: #error "Winsock and lwIP TCP/IP stack definitions shall not coexist!"

Please note that I am definitely NOT using Winsock. My platform
is, in fact, 90% POSIX compliant.

The problematic test is:

#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

In my case, HAVE_ERRNO_H is defined because I do have <errno.h>
as one would expect on a POSIX system:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html

Therefore, I believe the following patch should be applied.

--- setup.h.orig 2012-01-23 16:31:30.000000000 +0100
+++ setup.h 2012-03-08 17:42:38.140625000 +0100
@@ -623,7 +623,6 @@
 #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)

Do you agree with the proposed patch?
Or did I miss something?

-- 
Regards.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-08