summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-10-26 10:13:15 -0700
committerMichael Bestas <mikeioannina@gmail.com>2016-12-31 23:43:06 +0200
commit24ef6fe4e98363a97d0a729673d27ffebaed7cb2 (patch)
treeb19f01331dcd66387c6a2c7e5ec4a304e36ffece
parent23b2245ae6e2efc40c235d63b2ab1ab34b3b0ea3 (diff)
downloadart-24ef6fe4e98363a97d0a729673d27ffebaed7cb2.tar.gz
art-24ef6fe4e98363a97d0a729673d27ffebaed7cb2.tar.bz2
art-24ef6fe4e98363a97d0a729673d27ffebaed7cb2.zip
Fix build on XCode 8 w/OSX 10.12 SDK
CLOCK_REALTIME (along with clock_gettime and friends) are now defined, so the build fails with a redefinition error. Test: m checkbuild (w/XCode 8 on 10.11 with 10.12 SDK) Change-Id: Ic8a5cc872ded1766597fda5f098d0e044cd063ee
-rw-r--r--runtime/base/time_utils.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/base/time_utils.h b/runtime/base/time_utils.h
index 55d2764576..383b52fb33 100644
--- a/runtime/base/time_utils.h
+++ b/runtime/base/time_utils.h
@@ -73,9 +73,11 @@ static constexpr inline uint64_t MsToNs(uint64_t ms) {
}
#if defined(__APPLE__)
-// No clocks to specify on OS/X, fake value to pass to routines that require a clock.
+#ifndef CLOCK_REALTIME
+// No clocks to specify on OS/X < 10.12, fake value to pass to routines that require a clock.
#define CLOCK_REALTIME 0xebadf00d
#endif
+#endif
// Sleep for the given number of nanoseconds, a bad way to handle contention.
void NanoSleep(uint64_t ns);