All: Some portability fixes
Jeffrey Pfau jeffrey@endrift.com
Tue, 09 Jun 2015 21:22:11 -0700
3 files changed,
7 insertions(+),
5 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -160,7 +160,7 @@ list(APPEND OS_LIB ws2_32)
list(APPEND VFS_SRC ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-fd.c ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-dirent.c) file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/windows/*.c) source_group("Windows-specific code" FILES ${OS_SRC}) -else() +elseif(UNIX) add_definitions(-DUSE_PTHREADS) if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
M
src/util/vfs.h
→
src/util/vfs.h
@@ -8,13 +8,12 @@ #define VFS_H
#include "util/common.h" -#ifndef _WIN32 -#include <sys/mman.h> -#define PATH_SEP "/" -#else +#ifdef _WIN32 #include <io.h> #include <windows.h> #define PATH_SEP "\\" +#else +#define PATH_SEP "/" #endif #ifndef PATH_MAX
M
src/util/vfs/vfs-fd.c
→
src/util/vfs/vfs-fd.c
@@ -7,6 +7,9 @@ #include "util/vfs.h"
#include <fcntl.h> #include <sys/stat.h> +#ifndef _WIN32 +#include <sys/mman.h> +#endif struct VFileFD { struct VFile d;