All: Buildfixes for OS X and FreeBSD
Jeffrey Pfau jeffrey@endrift.com
Mon, 23 Mar 2015 02:47:10 -0700
3 files changed,
8 insertions(+),
1 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -120,16 +120,21 @@ list(APPEND OS_LIB ws2_32)
file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/windows/*.c) source_group("Windows-specific code" FILES ${OS_SRC}) else() - add_definitions(-DUSE_PTHREADS -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L) + add_definitions(-DUSE_PTHREADS) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_definitions(-D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L) + endif() if(NOT APPLE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") endif() + file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/posix/*.c) source_group("POSIX-specific code" FILES ${OS_SRC}) endif() if(APPLE) + add_definitions(-D_DARWIN_C_SOURCE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6") endif()
M
src/util/common.h
→
src/util/common.h
@@ -18,6 +18,7 @@ #include <stdint.h>
#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <strings.h> #include <unistd.h> #define UNUSED(V) (void)(V)
M
src/util/socket.h
→
src/util/socket.h
@@ -23,6 +23,7 @@ #include <errno.h>
#include <fcntl.h> #include <netinet/in.h> #include <netinet/tcp.h> +#include <sys/select.h> #include <sys/socket.h> #define INVALID_SOCKET (-1)