diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index d75091266..15c417616 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -40,6 +40,12 @@ #include #include +#ifdef __FreeBSD__ +#ifndef SOL_TCP +#define SOL_TCP IPPROTO_TCP +#endif +#endif + #ifdef __APPLE__ #ifndef SOL_TCP #define SOL_TCP IPPROTO_TCP diff --git a/libfreerdp/locale/timezone.c b/libfreerdp/locale/timezone.c index 3070f1fa6..724fd35d4 100644 --- a/libfreerdp/locale/timezone.c +++ b/libfreerdp/locale/timezone.c @@ -1663,7 +1663,11 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone) local_time = localtime(&t); #ifdef HAVE_TM_GMTOFF - clientTimeZone->bias = timezone / 60; + #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) diff --git a/winpr/libwinpr/crt/alignment.c b/winpr/libwinpr/crt/alignment.c index bf01e6ba6..a172cad9c 100644 --- a/winpr/libwinpr/crt/alignment.c +++ b/winpr/libwinpr/crt/alignment.c @@ -31,6 +31,8 @@ #ifdef __APPLE__ #include +#elif __FreeBSD__ +#include #else #include #endif diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index f3a6a9510..4000fabc2 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -124,7 +124,11 @@ static int pthread_timedjoin_np(pthread_t td, void **res, return ETIMEDOUT; } -static int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout) +#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; diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c index e93de0bff..fa0af5c15 100644 --- a/winpr/libwinpr/sysinfo/sysinfo.c +++ b/winpr/libwinpr/sysinfo/sysinfo.c @@ -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);