From 0a4038d06189391c8aa2fa4f8ef225db8e5429e7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 13 Dec 2017 00:15:58 +0400 Subject: [PATCH] Fix build with TDESKTOP_DISABLE_CRASH_REPORTS. Regression was introduced in 97c15865a5. Fixes #4173. --- Telegram/SourceFiles/core/crash_reports.cpp | 4 ++++ Telegram/SourceFiles/core/crash_reports.h | 4 ++++ Telegram/SourceFiles/platform/mac/specific_mac.mm | 2 ++ 3 files changed, 10 insertions(+) diff --git a/Telegram/SourceFiles/core/crash_reports.cpp b/Telegram/SourceFiles/core/crash_reports.cpp index 8f4e865257..0cf4df22d3 100644 --- a/Telegram/SourceFiles/core/crash_reports.cpp +++ b/Telegram/SourceFiles/core/crash_reports.cpp @@ -514,6 +514,8 @@ void SetAnnotationRef(const std::string &key, const QString *valuePtr) { } } +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS + dump::~dump() { if (ReportFile) { fflush(ReportFile); @@ -573,4 +575,6 @@ const dump &operator<<(const dump &stream, double num) { return stream; } +#endif // TDESKTOP_DISABLE_CRASH_REPORTS + } // namespace CrashReports diff --git a/Telegram/SourceFiles/core/crash_reports.h b/Telegram/SourceFiles/core/crash_reports.h index 392ca0a2f6..d7b14d5336 100644 --- a/Telegram/SourceFiles/core/crash_reports.h +++ b/Telegram/SourceFiles/core/crash_reports.h @@ -22,6 +22,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org namespace CrashReports { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS + struct dump { ~dump(); }; @@ -33,6 +35,8 @@ const dump &operator<<(const dump &stream, unsigned long num); const dump &operator<<(const dump &stream, unsigned long long num); const dump &operator<<(const dump &stream, double num); +#endif // TDESKTOP_DISABLE_CRASH_REPORTS + enum Status { CantOpen, LastCrashed, diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.mm b/Telegram/SourceFiles/platform/mac/specific_mac.mm index 2c56c393c8..a3f98f8303 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac.mm @@ -90,8 +90,10 @@ QAbstractNativeEventFilter *psNativeEventFilter() { } void psWriteDump() { +#ifndef TDESKTOP_DISABLE_CRASH_REPORTS double v = objc_appkitVersion(); CrashReports::dump() << "OS-Version: " << v; +#endif // TDESKTOP_DISABLE_CRASH_REPORTS } QString demanglestr(const QString &mangled) {