From 6796cfa72452552cc4d0f6bcfdbecace682ea1f6 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 8 Dec 2016 17:36:50 +0100 Subject: Fix include order --- src/semaphore.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/semaphore.cc b/src/semaphore.cc index 4a24e27..77bce9a 100644 --- a/src/semaphore.cc +++ b/src/semaphore.cc @@ -33,23 +33,21 @@ #include "platform.h" -#if DG_PLATFORM != DG_PLATFORM_WINDOWS -// Make sure we don't include /this/ file's header... -#include <../include/semaphore.h> -#include -#include -#include -#endif - #if DG_PLATFORM == DG_PLATFORM_OSX //#include #include -#endif -#if DG_PLATFORM == DG_PLATFORM_FREEBSD +#elif DG_PLATFORM == DG_PLATFORM_FREEBSD #include #include #include + +#elif DG_PLATFORM != DG_PLATFORM_WINDOWS +// Make sure we don't include /this/ file's header... +#include <../include/semaphore.h> +#include +#include +#include #endif struct semaphore_private_t { @@ -131,7 +129,11 @@ bool Semaphore::wait(const std::chrono::milliseconds& timeout) return false; } #elif DG_PLATFORM == DG_PLATFORM_FREEBSD - sema_timedwait(prv->semaphore, timeout.count()); + auto ret = sema_timedwait(prv->semaphore, timeout.count()); + if(ret != 0) + { + return false; + } #else struct timespec ts; -- cgit v1.2.3