Loading base/Android.bp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -45,6 +45,7 @@ cc_library { support_system_process: true, support_system_process: true, }, }, srcs: [ srcs: [ "chrono_utils.cpp", "file.cpp", "file.cpp", "logging.cpp", "logging.cpp", "parsenetaddress.cpp", "parsenetaddress.cpp", Loading Loading @@ -72,14 +73,12 @@ cc_library { }, }, linux: { linux: { srcs: [ srcs: [ "chrono_utils.cpp", "errors_unix.cpp", "errors_unix.cpp", ], ], cppflags: ["-Wexit-time-destructors"], cppflags: ["-Wexit-time-destructors"], }, }, darwin: { darwin: { srcs: [ srcs: [ "chrono_utils.cpp", "errors_unix.cpp", "errors_unix.cpp", ], ], cppflags: ["-Wexit-time-destructors"], cppflags: ["-Wexit-time-destructors"], Loading base/chrono_utils.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ boot_clock::time_point boot_clock::now() { return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) + return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) + std::chrono::nanoseconds(ts.tv_nsec)); std::chrono::nanoseconds(ts.tv_nsec)); #else #else // Darwin does not support clock_gettime. // Darwin and Windows do not support clock_gettime. return boot_clock::time_point(); return boot_clock::time_point(); #endif // __linux__ #endif // __linux__ } } Loading base/include/android-base/chrono_utils.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,9 @@ #include <chrono> #include <chrono> #include <sstream> #include <sstream> #if __cplusplus > 201103L // C++14 using namespace std::chrono_literals; using namespace std::chrono_literals; #endif namespace android { namespace android { namespace base { namespace base { Loading Loading
base/Android.bp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -45,6 +45,7 @@ cc_library { support_system_process: true, support_system_process: true, }, }, srcs: [ srcs: [ "chrono_utils.cpp", "file.cpp", "file.cpp", "logging.cpp", "logging.cpp", "parsenetaddress.cpp", "parsenetaddress.cpp", Loading Loading @@ -72,14 +73,12 @@ cc_library { }, }, linux: { linux: { srcs: [ srcs: [ "chrono_utils.cpp", "errors_unix.cpp", "errors_unix.cpp", ], ], cppflags: ["-Wexit-time-destructors"], cppflags: ["-Wexit-time-destructors"], }, }, darwin: { darwin: { srcs: [ srcs: [ "chrono_utils.cpp", "errors_unix.cpp", "errors_unix.cpp", ], ], cppflags: ["-Wexit-time-destructors"], cppflags: ["-Wexit-time-destructors"], Loading
base/chrono_utils.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ boot_clock::time_point boot_clock::now() { return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) + return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) + std::chrono::nanoseconds(ts.tv_nsec)); std::chrono::nanoseconds(ts.tv_nsec)); #else #else // Darwin does not support clock_gettime. // Darwin and Windows do not support clock_gettime. return boot_clock::time_point(); return boot_clock::time_point(); #endif // __linux__ #endif // __linux__ } } Loading
base/include/android-base/chrono_utils.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -20,7 +20,9 @@ #include <chrono> #include <chrono> #include <sstream> #include <sstream> #if __cplusplus > 201103L // C++14 using namespace std::chrono_literals; using namespace std::chrono_literals; #endif namespace android { namespace android { namespace base { namespace base { Loading