summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorMark Salyzyn2018-02-05 09:41:31 -0600
committerMark Salyzyn2018-02-05 11:33:10 -0600
commit0c071c9de7aa40301cfc945f08d1783f2831ee5c (patch)
treee5182c884c4b4e1afe155556ab2c0a507e5faf76 /base
parent7c271bdc3b240779ad78ab379ae98925785fac70 (diff)
downloadplatform-system-core-0c071c9de7aa40301cfc945f08d1783f2831ee5c.tar.gz
platform-system-core-0c071c9de7aa40301cfc945f08d1783f2831ee5c.tar.xz
platform-system-core-0c071c9de7aa40301cfc945f08d1783f2831ee5c.zip
base: adb.exe build error
Windows build of adb is broken because of the lack of std::chrono_literals and for an implementation of android::boot_clock::now(). Test: make -j vts Bug: 72941624 Change-Id: Ie65fed098633eb45a94ea553de6903f8d55fc5b2
Diffstat (limited to 'base')
-rw-r--r--base/Android.bp3
-rw-r--r--base/chrono_utils.cpp2
-rw-r--r--base/include/android-base/chrono_utils.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/base/Android.bp b/base/Android.bp
index 01800afad..6cadcfc0f 100644
--- a/base/Android.bp
+++ b/base/Android.bp
@@ -45,6 +45,7 @@ cc_library {
45 support_system_process: true, 45 support_system_process: true,
46 }, 46 },
47 srcs: [ 47 srcs: [
48 "chrono_utils.cpp",
48 "file.cpp", 49 "file.cpp",
49 "logging.cpp", 50 "logging.cpp",
50 "parsenetaddress.cpp", 51 "parsenetaddress.cpp",
@@ -72,14 +73,12 @@ cc_library {
72 }, 73 },
73 linux: { 74 linux: {
74 srcs: [ 75 srcs: [
75 "chrono_utils.cpp",
76 "errors_unix.cpp", 76 "errors_unix.cpp",
77 ], 77 ],
78 cppflags: ["-Wexit-time-destructors"], 78 cppflags: ["-Wexit-time-destructors"],
79 }, 79 },
80 darwin: { 80 darwin: {
81 srcs: [ 81 srcs: [
82 "chrono_utils.cpp",
83 "errors_unix.cpp", 82 "errors_unix.cpp",
84 ], 83 ],
85 cppflags: ["-Wexit-time-destructors"], 84 cppflags: ["-Wexit-time-destructors"],
diff --git a/base/chrono_utils.cpp b/base/chrono_utils.cpp
index dbe54830f..19080a5a7 100644
--- a/base/chrono_utils.cpp
+++ b/base/chrono_utils.cpp
@@ -28,7 +28,7 @@ boot_clock::time_point boot_clock::now() {
28 return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) + 28 return boot_clock::time_point(std::chrono::seconds(ts.tv_sec) +
29 std::chrono::nanoseconds(ts.tv_nsec)); 29 std::chrono::nanoseconds(ts.tv_nsec));
30#else 30#else
31 // Darwin does not support clock_gettime. 31 // Darwin and Windows do not support clock_gettime.
32 return boot_clock::time_point(); 32 return boot_clock::time_point();
33#endif // __linux__ 33#endif // __linux__
34} 34}
diff --git a/base/include/android-base/chrono_utils.h b/base/include/android-base/chrono_utils.h
index 7679d4c94..c3396ee2f 100644
--- a/base/include/android-base/chrono_utils.h
+++ b/base/include/android-base/chrono_utils.h
@@ -20,7 +20,9 @@
20#include <chrono> 20#include <chrono>
21#include <sstream> 21#include <sstream>
22 22
23#if __cplusplus > 201103L // C++14
23using namespace std::chrono_literals; 24using namespace std::chrono_literals;
25#endif
24 26
25namespace android { 27namespace android {
26namespace base { 28namespace base {