Revert "base: make boot_clock work on host linux, hide it on non-linux."
This reverts commit ae29339ca138648eeaee68f801feb02d85ee2abf, which broke the darwin build.
Change-Id: Ib33e2dab197532f04944cb12151002e9219b1bb5
diff --git a/base/chrono_utils.cpp b/base/chrono_utils.cpp
index d73b551..5eedf3b 100644
--- a/base/chrono_utils.cpp
+++ b/base/chrono_utils.cpp
@@ -21,14 +21,17 @@
namespace android {
namespace base {
-#if defined(__linux__)
boot_clock::time_point boot_clock::now() {
+#ifdef __ANDROID__
timespec ts;
clock_gettime(CLOCK_BOOTTIME, &ts);
return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) +
std::chrono::nanoseconds(ts.tv_nsec));
+#else
+ // Darwin does not support clock_gettime.
+ return boot_clock::time_point();
+#endif // __ANDROID__
}
-#endif
} // namespace base
} // namespace android