Skip to content

Commit

Permalink
libbladeRF: Use system clock_gettime on macOS >= 10.12.
Browse files Browse the repository at this point in the history
  • Loading branch information
tee3 committed Dec 9, 2016
1 parent ab12ebd commit b6f6267
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions host/common/include/osx/clock_gettime.h
Expand Up @@ -27,6 +27,10 @@

#include <time.h>

#include "AvailabilityMacros.h"

#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -45,3 +49,5 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp);
#endif

#endif

#endif
6 changes: 6 additions & 0 deletions host/common/src/osx/clock_gettime.c
@@ -1,3 +1,7 @@
#include "AvailabilityMacros.h"

#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12

/*
* clock_gettime() wrapper for OSX based upon jbenet's github "gist":
* https://gist.github.com/jbenet/1087739
Expand Down Expand Up @@ -56,3 +60,5 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
return 0;
}
}

#endif

0 comments on commit b6f6267

Please sign in to comment.