all repos — mgba @ 9bb306f8319796d1e96079f93525c214e7687bf1

mGBA Game Boy Advance Emulator

All: Buildfixes for OS X and FreeBSD
Jeffrey Pfau jeffrey@endrift.com
Mon, 23 Mar 2015 02:47:10 -0700
commit

9bb306f8319796d1e96079f93525c214e7687bf1

parent

b55c873e3401b255cba436e6e85eea59f3d5293c

3 files changed, 8 insertions(+), 1 deletions(-)

jump to
M CMakeLists.txtCMakeLists.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.hsrc/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.hsrc/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)