Beast fixes for FreeBSD

This commit is contained in:
Vinnie Falco
2013-06-20 13:38:44 -07:00
parent b09c5359a9
commit 66474e6f9d
5 changed files with 29 additions and 12 deletions

View File

@@ -40,7 +40,10 @@
#include <locale> #include <locale>
#include <cctype> #include <cctype>
#include <sys/timeb.h>
#if ! BEAST_BSD
#include <sys/timeb.h>
#endif
#if ! BEAST_ANDROID #if ! BEAST_ANDROID
#include <cwctype> #include <cwctype>
@@ -85,7 +88,7 @@
#include <net/if.h> #include <net/if.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#if ! BEAST_ANDROID #if ! BEAST_ANDROID && ! BEAST_BSD
#include <execinfo.h> #include <execinfo.h>
#endif #endif
#endif #endif

View File

@@ -68,11 +68,11 @@
#elif BEAST_WINDOWS #elif BEAST_WINDOWS
#if BEAST_MSVC #if BEAST_MSVC
#ifndef _CPPRTTI #ifndef _CPPRTTI
#error "You're compiling without RTTI enabled! This is needed for a lot of BEAST classes, please update your compiler settings!" #error "Beast requires RTTI!"
#endif #endif
#ifndef _CPPUNWIND #ifndef _CPPUNWIND
#error "You're compiling without exceptions enabled! This is needed for a lot of BEAST classes, please update your compiler settings!" #error "Beast requires RTTI!"
#endif #endif
#pragma warning (push) #pragma warning (push)
@@ -161,15 +161,13 @@
type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName); type##localFunctionName localFunctionName = (type##localFunctionName) dll.getFunction (#functionName);
//============================================================================== //==============================================================================
#elif BEAST_LINUX #elif BEAST_LINUX || BEAST_BSD
#include <sched.h> #include <sched.h>
#include <pthread.h> #include <pthread.h>
#include <sys/time.h> #include <sys/time.h>
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/dir.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <sys/vfs.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <fnmatch.h> #include <fnmatch.h>
@@ -184,12 +182,21 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <net/if.h> #include <net/if.h>
#include <sys/sysinfo.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/prctl.h>
#include <signal.h> #include <signal.h>
#include <stddef.h> #include <stddef.h>
#if BEAST_BSD
#include <dirent.h>
#include <sys/param.h>
#include <sys/mount.h>
#else
#include <sys/dir.h>
#include <sys/vfs.h>
#include <sys/sysinfo.h>
#include <sys/prctl.h>
#endif
//============================================================================== //==============================================================================
#elif BEAST_ANDROID #elif BEAST_ANDROID
#include <jni.h> #include <jni.h>

View File

@@ -177,7 +177,8 @@ bool File::setAsCurrentWorkingDirectory() const
//============================================================================== //==============================================================================
namespace namespace
{ {
#if BEAST_LINUX || (BEAST_IOS && ! __DARWIN_ONLY_64_BIT_INO_T) // (this iOS stuff is to avoid a simulator bug) #if BEAST_LINUX || \
(BEAST_IOS && ! __DARWIN_ONLY_64_BIT_INO_T) // (this iOS stuff is to avoid a simulator bug)
typedef struct stat64 beast_statStruct; typedef struct stat64 beast_statStruct;
#define BEAST_STAT stat64 #define BEAST_STAT stat64
#else #else
@@ -1217,7 +1218,11 @@ private:
t.tv_sec = (time_t) (time / 1000000000); t.tv_sec = (time_t) (time / 1000000000);
t.tv_nsec = (long) (time % 1000000000); t.tv_nsec = (long) (time % 1000000000);
#if BEAST_BSD
bassertfalse; // unimplemented
#else
clock_nanosleep (CLOCK_MONOTONIC, TIMER_ABSTIME, &t, nullptr); clock_nanosleep (CLOCK_MONOTONIC, TIMER_ABSTIME, &t, nullptr);
#endif
} }
uint64 time, delta; uint64 time, delta;

View File

@@ -68,7 +68,7 @@ String SystemStats::getStackBacktrace()
{ {
String result; String result;
#if BEAST_ANDROID || BEAST_MINGW #if BEAST_ANDROID || BEAST_MINGW || BEAST_BSD
bassertfalse; // sorry, not implemented yet! bassertfalse; // sorry, not implemented yet!
#elif BEAST_WINDOWS #elif BEAST_WINDOWS

View File

@@ -59,6 +59,8 @@
#else #else
#define BEAST_MAC 1 #define BEAST_MAC 1
#endif #endif
#elif defined (__FreeBSD__)
#define BEAST_BSD 1
#else #else
#error "Unknown platform!" #error "Unknown platform!"
#endif #endif
@@ -135,7 +137,7 @@
#endif #endif
//============================================================================== //==============================================================================
#if BEAST_LINUX || BEAST_ANDROID #if BEAST_LINUX || BEAST_ANDROID || BEAST_BSD
#ifdef _DEBUG #ifdef _DEBUG
#define BEAST_DEBUG 1 #define BEAST_DEBUG 1