FreeBSD compile errors

This commit is contained in:
Hobby-Student 2014-05-01 15:09:35 +02:00
parent 02595df976
commit 03315cebe8
5 changed files with 23 additions and 3 deletions

View File

@ -40,6 +40,12 @@
#include <netinet/tcp.h>
#include <net/if.h>
#ifdef __FreeBSD__
#ifndef SOL_TCP
#define SOL_TCP IPPROTO_TCP
#endif
#endif
#ifdef __APPLE__
#ifndef SOL_TCP
#define SOL_TCP IPPROTO_TCP

View File

@ -1663,7 +1663,11 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
local_time = localtime(&t);
#ifdef HAVE_TM_GMTOFF
#if defined(___FreeBSD__)
clientTimeZone->bias = timezone;
#else
clientTimeZone->bias = timezone / 60;
#endif
DEBUG_TIMEZONE("tzname[std]: %s, tzname[dst]: %s, timezone: %ld, Daylight: %d", tzname[0], tzname[1], timezone, daylight);
#elif defined(sun)
if (local_time->tm_isdst > 0)

View File

@ -31,6 +31,8 @@
#ifdef __APPLE__
#include <malloc/malloc.h>
#elif __FreeBSD__
#include <stdlib.h>
#else
#include <malloc.h>
#endif

View File

@ -124,7 +124,11 @@ static int pthread_timedjoin_np(pthread_t td, void **res,
return ETIMEDOUT;
}
#if defined(__FreeBSD__)
static int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout)
#else
static int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout)
#endif
{
struct timespec timenow;
struct timespec sleepytime;

View File

@ -129,7 +129,11 @@ static DWORD GetNumberOfProcessors()
size_t length = sizeof(numCPUs);
mib[0] = CTL_HW;
mib[1] = HW_AVAILCPU;
#if defined(__FreeBSD__)
mib[1] = HW_NCPU;
#else
mid[1] = HW_AVAILCPU;
#endif
sysctl(mib, 2, &numCPUs, &length, NULL, 0);