summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorTaybin Rutkin <taybin@taybin.com>2010-07-06 01:25:06 +0000
committerTaybin Rutkin <taybin@taybin.com>2010-07-06 01:25:06 +0000
commit2f11b367cac5fe05f5f69e2c73946312d8145260 (patch)
treec2f6ab6635cd5ac02b0cc42518353cdfb3f8906b /libs
parentd3b422d06405a150680b75e184b22cccebc7da4c (diff)
fix compiling file_manager.cc on osx
clock_gettime() and CLOCK_MONOTONIC aren't implemented on osx. Replaced with get_absolute_time() as suggested here: http://www.wand.net.nz/~smr26/wordpress/2009/01/19/monotonic-time-in-mac-os-x/ git-svn-id: svn://localhost/ardour2/branches/3.0@7380 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/pbd/file_manager.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/pbd/file_manager.cc b/libs/pbd/file_manager.cc
index 1ababb79bb..0f05ecedc4 100644
--- a/libs/pbd/file_manager.cc
+++ b/libs/pbd/file_manager.cc
@@ -25,6 +25,11 @@
#include <cassert>
#include <iostream>
#include <cstdio>
+
+#ifdef __APPLE__
+#include <mach/mach_time.h>
+#endif
+
#include "pbd/compose.h"
#include "pbd/file_manager.h"
#include "pbd/debug.h"
@@ -110,9 +115,13 @@ FileManager::allocate (FileDescriptor* d)
DEBUG_TRACE (DEBUG::FileManager, string_compose ("opened file for %1; now have %2 of %3 open.\n", d->_name, _open, _max_open));
}
+#ifdef __APPLE__
+ d->_last_used = get_absolute_time();
+#else
struct timespec t;
clock_gettime (CLOCK_MONOTONIC, &t);
d->_last_used = t.tv_sec + (double) t.tv_nsec / 10e9;
+#endif
d->_refcount++;