diff options
author | Josh Gao <jmgao@google.com> | 2017-04-28 12:39:48 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-04-28 13:00:00 -0700 |
commit | ae29339ca138648eeaee68f801feb02d85ee2abf (patch) | |
tree | fae72a160e4812f326207e25b40a167980d649fd /base/include/android-base/chrono_utils.h | |
parent | 263e1e95093b9f66b7d62cbd622e09b6a8b9252f (diff) |
base: make boot_clock work on host linux, hide it on non-linux.
boot_clock was previously returning zero on any platform that doesn't
define __ANDROID__, including host bionic. Instead of returning a bogus
value, just hide it on non-Linux platforms.
Bug: http://b/37758947
Test: libbase_test32/64 on linux
Change-Id: I96e1d8b92dc44c6308408900cf0d27e1e7db5569
Diffstat (limited to 'base/include/android-base/chrono_utils.h')
-rw-r--r-- | base/include/android-base/chrono_utils.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/base/include/android-base/chrono_utils.h b/base/include/android-base/chrono_utils.h index 0086425e5a..795225b9c5 100644 --- a/base/include/android-base/chrono_utils.h +++ b/base/include/android-base/chrono_utils.h @@ -22,6 +22,7 @@ namespace android { namespace base { +#if defined(__linux__) // A std::chrono clock based on CLOCK_BOOTTIME. class boot_clock { public: @@ -30,6 +31,7 @@ class boot_clock { static time_point now(); }; +#endif // defined(__linux__) } // namespace base } // namespace android |