@@ -838,14 +838,11 @@ extern int use_rt_clock;
static inline int64_t get_clock(void)
{
-#ifdef CLOCK_MONOTONIC
if (use_rt_clock) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return ts.tv_sec * 1000000000LL + ts.tv_nsec;
- } else
-#endif
- {
+ } else {
/* XXX: using gettimeofday leads to problems if the date
changes, so it should be avoided. */
return get_clock_realtime();
@@ -49,14 +49,11 @@ int use_rt_clock;
static void __attribute__((constructor)) init_get_clock(void)
{
+ struct timespec ts;
+
use_rt_clock = 0;
-#ifdef CLOCK_MONOTONIC
- {
- struct timespec ts;
- if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
- use_rt_clock = 1;
- }
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
+ use_rt_clock = 1;
}
-#endif
}
#endif