]> granicus.if.org Git - curl/commitdiff
rtmp: fix for compiling with lwIP
authorGisle Vanem <gisle.vanem@gmail.com>
Mon, 22 Oct 2018 08:33:44 +0000 (10:33 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Oct 2018 22:04:02 +0000 (00:04 +0200)
Compiling on _WIN32 and 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)
                                 ^
Closes #3155

lib/curl_rtmp.c

index 97430647bf649dfab8bdad7b82be6a9c93c67afe..f09f2f332db9927e95eeaa64b01f81476f2d97a7 100644 (file)
 /* 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
+#elif defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD)
+#define SET_RCVTIMEO(tv,s)   int tv = s*1000
 #else
 #define SET_RCVTIMEO(tv,s)   struct timeval tv = {s,0}
 #endif