Skip to content

Commit 7b36242

Browse files
committed
fixed crashpad build on Windows with C++20
1 parent 02c32b0 commit 7b36242

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

framework/diagnostics/thirdparty/google_crashpad_client/client/crash_report_database_win.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ void Metadata::Write() {
537537
for (const auto& report : reports_) {
538538
const base::FilePath& path = report.file_path;
539539
if (path.DirName() != report_dir_) {
540-
LOG(ERROR) << path.value().c_str() << " expected to start with "
540+
LOG(ERROR) << base::WideToUTF8(path.value()) << " expected to start with "
541541
<< base::WideToUTF8(report_dir_.value());
542542
return;
543543
}
@@ -693,7 +693,7 @@ FileWriter* CrashReportDatabase::NewReport::AddAttachment(
693693
auto writer = std::make_unique<FileWriter>();
694694
if (!writer->Open(
695695
path, FileWriteMode::kCreateOrFail, FilePermissions::kOwnerOnly)) {
696-
LOG(ERROR) << "could not open " << path.value().c_str();
696+
LOG(ERROR) << "could not open " << base::WideToUTF8(path.value());
697697
return nullptr;
698698
}
699699
attachment_writers_.emplace_back(std::move(writer));
@@ -719,7 +719,7 @@ void CrashReportDatabase::UploadReport::InitializeAttachments() {
719719
const base::FilePath filepath(attachments_dir.Append(filename));
720720
std::unique_ptr<FileReader> file_reader(std::make_unique<FileReader>());
721721
if (!file_reader->Open(filepath)) {
722-
LOG(ERROR) << "attachment " << filepath.value().c_str()
722+
LOG(ERROR) << "attachment " << base::WideToUTF8(filepath.value())
723723
<< " couldn't be opened, skipping";
724724
continue;
725725
}
@@ -1086,7 +1086,7 @@ void CrashReportDatabaseWin::CleanOrphanedAttachments() {
10861086
UUID uuid;
10871087
if (!uuid.InitializeFromString(filename.value())) {
10881088
LOG(ERROR) << "unexpected attachment dir name "
1089-
<< filename.value().c_str();
1089+
<< base::WideToUTF8(filename.value());
10901090
continue;
10911091
}
10921092

framework/diagnostics/thirdparty/google_crashpad_client/third_party/mini_chromium/mini_chromium/base/files/file_path.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,6 @@ void FilePath::StripTrailingSeparatorsInternal() {
287287

288288
} // namespace base
289289

290-
void PrintTo(const base::FilePath& path, std::ostream* out) {
291-
*out << path.value().c_str();
292-
}
290+
// void PrintTo(const base::FilePath& path, std::ostream* out) {
291+
// *out << path.value().c_str();
292+
// }

framework/diagnostics/thirdparty/google_crashpad_client/third_party/mini_chromium/mini_chromium/base/files/file_path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class FilePath {
227227
} // namespace base
228228

229229
// This is required by googletest to print a readable output on test failures.
230-
extern void PrintTo(const base::FilePath& path, std::ostream* out);
230+
// extern void PrintTo(const base::FilePath& path, std::ostream* out);
231231

232232
// Macros for string literal initialization of FilePath::CharType[], and for
233233
// using a FilePath::CharType[] in a printf-style format string.

framework/diagnostics/thirdparty/google_crashpad_client/util/stdlib/aligned_allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct AlignedAllocator {
6969
pointer address(reference x) const noexcept { return &x; }
7070
const_pointer address(const_reference x) const noexcept { return &x; }
7171

72-
pointer allocate(size_type n, std::allocator<void>::const_pointer hint = 0) {
72+
pointer allocate(size_type n, const void* hint = nullptr) {
7373
return reinterpret_cast<pointer>(
7474
AlignedAllocate(Alignment, sizeof(value_type) * n));
7575
}

0 commit comments

Comments
 (0)