summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-18 08:33:27 +0000
committerDavid Robillard <d@drobilla.net>2014-12-18 08:33:27 +0000
commitc55ed19e4eacb472aef89db9e9c0e048c168c53f (patch)
tree7552fced9ae807d88d7c441e64cae3239a4abf06
parent4b0ac1dfa4a03099f59dc07c2d97e06be2bf2651 (diff)
downloadraul-c55ed19e4eacb472aef89db9e9c0e048c168c53f.tar.gz
raul-c55ed19e4eacb472aef89db9e9c0e048c168c53f.tar.bz2
raul-c55ed19e4eacb472aef89db9e9c0e048c168c53f.zip
Fix compilation on OSX.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@5501 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--raul/Semaphore.hpp5
-rw-r--r--wscript4
2 files changed, 6 insertions, 3 deletions
diff --git a/raul/Semaphore.hpp b/raul/Semaphore.hpp
index dbebf06..9979a09 100644
--- a/raul/Semaphore.hpp
+++ b/raul/Semaphore.hpp
@@ -134,8 +134,9 @@ Semaphore::try_wait()
inline bool
Semaphore::timed_wait(unsigned ms)
{
- const unsigned seconds = ms / 1000;
- const mach_timespec_t t = { seconds, (ms - (seconds * 1000)) * 1000000 };
+ const unsigned s = ms / 1000;
+ const int nsec = ((int)ms - (s * 1000)) * 1000000;
+ const mach_timespec_t t = { s, nsec };
return semaphore_timedwait(_sem, t) == KERN_SUCCESS;
}
diff --git a/wscript b/wscript
index 4070c03..69a2219 100644
--- a/wscript
+++ b/wscript
@@ -102,8 +102,10 @@ def build(bld):
framework = ' CoreServices '
if bld.env.BUILD_TESTS:
- test_libs = ['pthread', 'rt']
+ test_libs = ['pthread']
test_cxxflags = []
+ if bld.env.DEST_OS != 'darwin' and bld.env.DEST_OS != 'win32':
+ test_libs += ['rt']
if bld.is_defined('HAVE_GCOV'):
test_libs += ['gcov']
test_cxxflags += ['-fprofile-arcs', '-ftest-coverage']