]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
deal with linux platforms that have clock_gettime but don't define CLOCK_MONOTONIC...
authorMichael Jerris <mike@jerris.com>
Sun, 23 Mar 2008 00:22:18 +0000 (00:22 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 23 Mar 2008 00:22:18 +0000 (00:22 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7950 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_time.c

index 5f9ea90b22bec710441a10d250f99e1dacfa7879..f9bc7f22d48739af8744d19b2499b2e27eb98dde 100644 (file)
@@ -95,7 +95,7 @@ SWITCH_DECLARE(time_t) switch_timestamp(time_t *t)
        return now;
 }
 
-#if defined(HAVE_CLOCK_GETTIME)
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
 static int MONO = 1;
 #else
 static int MONO = 0;
@@ -105,7 +105,7 @@ static switch_time_t time_now(int64_t offset)
 {
        switch_time_t now;
 
-#if defined(HAVE_CLOCK_GETTIME)
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
        if (MONO) {
                struct timespec ts;
                clock_gettime(CLOCK_MONOTONIC, &ts);
@@ -114,7 +114,7 @@ static switch_time_t time_now(int64_t offset)
 #endif
        now = switch_time_now();
 
-#if defined(HAVE_CLOCK_GETTIME)
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
        }
 #endif