Linux clock_gettime needs rt / librt, so put it behind BT_LINUX_REALTIME for now.
This commit is contained in:
@@ -56,7 +56,12 @@
|
|||||||
|
|
||||||
#else //_WIN32
|
#else //_WIN32
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#ifdef BT_LINUX_REALTIME
|
||||||
|
//required linking against rt (librt)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#endif //BT_LINUX_REALTIME
|
||||||
|
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
#define mymin(a,b) (a > b ? a : b)
|
#define mymin(a,b) (a > b ? a : b)
|
||||||
@@ -248,16 +253,17 @@ unsigned long long int btClock::getTimeNanoseconds()
|
|||||||
|
|
||||||
#else//__APPLE__
|
#else//__APPLE__
|
||||||
|
|
||||||
|
#ifdef BT_LINUX_REALTIME
|
||||||
timespec ts;
|
timespec ts;
|
||||||
clock_gettime(CLOCK_REALTIME,&ts);
|
clock_gettime(CLOCK_REALTIME,&ts);
|
||||||
return 1000000000*ts.tv_sec + ts.tv_nsec;
|
return 1000000000*ts.tv_sec + ts.tv_nsec;
|
||||||
|
#else
|
||||||
|
struct timeval currentTime;
|
||||||
/* struct timeval currentTime;
|
|
||||||
gettimeofday(¤tTime, 0);
|
gettimeofday(¤tTime, 0);
|
||||||
return (currentTime.tv_sec - m_data->mStartTime.tv_sec) * 1e9 +
|
return (currentTime.tv_sec - m_data->mStartTime.tv_sec) * 1e9 +
|
||||||
(currentTime.tv_usec - m_data->mStartTime.tv_usec)*1000;
|
(currentTime.tv_usec - m_data->mStartTime.tv_usec)*1000;
|
||||||
*/
|
#endif //BT_LINUX_REALTIME
|
||||||
|
|
||||||
#endif//__APPLE__
|
#endif//__APPLE__
|
||||||
#endif//__CELLOS_LV2__
|
#endif//__CELLOS_LV2__
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user