1
0
Fork 0
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:
Tommy Nguyen 2014-12-18 23:41:48 +01:00
parent 3ae1badae7
commit 771618e6c2
2 changed files with 4 additions and 1 deletions

View file

@ -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)

View file

@ -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");