curl-library
[Win32] Fix for compiling with lwIP
Date: Mon, 22 Oct 2018 11:11:57 +0200
I tried creating a Pull-Request on Github.
But got a:
   Pull request creation failed. Validation failed: A pull request
   already exists for curl:lwip-patch.
So here it is the old way:
Compiling on Windows (`_WIN32`) with `USE_LWIPSOCK`, causes this error:
   curl_rtmp.c(223,3):  error: use of undeclared identifier 'setsockopt'
     setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO,
     ^
   curl_rtmp.c(41,32):  note: expanded from macro 'setsockopt'
   #define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
                                  ^
(from with clang-cl).
Patch:
--- a/lib/curl_rtmp.c 2018-05-09 19:58:09
+++ b/lib/curl_rtmp.c 2018-10-22 08:27:15
@@ -37,7 +37,7 @@
  /* The last #include file should be: */
  #include "memdebug.h"
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(USE_LWIPSOCK)
  #define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
  #define SET_RCVTIMEO(tv,s)   int tv = s*1000
  #else
---------------
And BTW, the noise-level from clang-cl from memdebug.h is staggering.
E.g.
In file included from wildcard.c:31:
./memdebug.h(99,9):  warning: 'send' macro redefined [-Wmacro-redefined]
#define send(a,b,c,d) curl_dosend(a,b,c,d, __LINE__, __FILE__)
         ^
f:/MingW32/src/inet/lwip/src/include\lwip/sockets.h(640,9):  note: previous definition is here
#define send(s,dataptr,size,flags)                lwip_send(s,dataptr,size,flags)
         ^
In file included from wildcard.c:31:
./memdebug.h(100,9):  warning: 'recv' macro redefined [-Wmacro-redefined]
#define recv(a,b,c,d) curl_dorecv(a,b,c,d, __LINE__, __FILE__)
         ^
f:/MingW32/src/inet/lwip/src/include\lwip/sockets.h(634,9):  note: previous definition is here
#define recv(s,mem,len,flags)                     lwip_recv(s,mem,len,flags)
         ^
-- --gv ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2018-10-22