diff options
author | Yi Kong <yikong@google.com> | 2024-05-24 10:07:18 +0900 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2024-06-02 16:19:30 +0000 |
commit | 73a5021d10ba165537d058b3b12d22a2143c94ee (patch) | |
tree | 7433e74694d3915135705380cc3e1caec9319946 | |
parent | e589fe4031bb4ab39e74cbc38897c4af60250eaf (diff) | |
download | extras-73a5021d10ba165537d058b3b12d22a2143c94ee.tar.gz |
Fix build with ToT libc++
system/extras/simpleperf/utils.h:81:53: error: no matching constructor for initialization of 'std::ifstream' (aka 'basic_ifstream<char>')
81 | explicit LineReader(std::string_view file_path) : ifs_(file_path) {}
| ^ ~~~~~~~~~
Test: Build with ToT libc++
Change-Id: I45a12b7cee66b35c8859bb5f71c7784d1dfc4f74
-rw-r--r-- | simpleperf/utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/simpleperf/utils.h b/simpleperf/utils.h index 0409387f..8f4a809b 100644 --- a/simpleperf/utils.h +++ b/simpleperf/utils.h @@ -78,7 +78,7 @@ class OneTimeFreeAllocator { class LineReader { public: - explicit LineReader(std::string_view file_path) : ifs_(file_path) {} + explicit LineReader(std::string_view file_path) : ifs_(std::string(file_path).c_str()) {} // Return true if open file successfully. bool Ok() const { return ifs_.good(); } // If available, return next line content with new line, otherwise return nullptr. |