mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
Fix for compiling with clang -std=c11 on Linux.
This commit is contained in:
parent
3ae1badae7
commit
771618e6c2
2 changed files with 4 additions and 1 deletions
|
@ -393,6 +393,9 @@ if (UNIX)
|
|||
list(APPEND HDR_PRIVATE lib/getifaddrs.h)
|
||||
list(APPEND SOURCES lib/getifaddrs.c)
|
||||
endif()
|
||||
if (NOT APPLE)
|
||||
add_definitions(-D_POSIX_SOURCE=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
|
|
@ -235,7 +235,7 @@ lws_plat_set_socket_options(struct libwebsocket_context *context, int fd)
|
|||
optval = 1;
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
|
||||
!defined(__OpenBSD__)
|
||||
if (setsockopt(fd, SOL_TCP, TCP_NODELAY, (const void *)&optval, optlen) < 0)
|
||||
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (const void *)&optval, optlen) < 0)
|
||||
return 1;
|
||||
#else
|
||||
tcp_proto = getprotobyname("TCP");
|
||||
|
|
Loading…
Add table
Reference in a new issue