13
0

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
This commit is contained in:
Taybin Rutkin 2010-07-06 01:25:06 +00:00
parent d3b422d064
commit 2f11b367ca

View File

@ -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++;