1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Move compile-time testing of crash report support out of Experimental.h

This commit is contained in:
Paul Licameli 2020-06-19 22:47:27 -04:00
parent 83efa5a0df
commit c781a108e3
7 changed files with 23 additions and 37 deletions

View File

@ -29,6 +29,7 @@ It handles initialization and termination by subclassing wxApp.
#include <wx/setup.h> // for wxUSE_* macros
#include <wx/wxcrtvararg.h>
#include <wx/defs.h>
#include <wx/evtloop.h>
#include <wx/app.h>
#include <wx/bitmap.h>
#include <wx/docview.h>
@ -76,7 +77,7 @@ It handles initialization and termination by subclassing wxApp.
#include "AudioIO.h"
#include "Benchmark.h"
#include "Clipboard.h"
#include "CrashReport.h"
#include "CrashReport.h" // for HAS_CRASH_REPORT
#include "commands/CommandHandler.h"
#include "commands/AppCommandEvent.h"
#include "widgets/ASlider.h"
@ -122,12 +123,6 @@ It handles initialization and termination by subclassing wxApp.
#include "import/Import.h"
#if defined(EXPERIMENTAL_CRASH_REPORT)
#include <wx/debugrpt.h>
#include <wx/evtloop.h>
#include <wx/textdlg.h>
#endif
#ifdef EXPERIMENTAL_SCOREALIGN
#include "effects/ScoreAlignDialog.h"
#endif
@ -940,7 +935,7 @@ wxLanguageInfo userLangs[] =
void AudacityApp::OnFatalException()
{
#if defined(EXPERIMENTAL_CRASH_REPORT)
#if defined(HAS_CRASH_REPORT)
CrashReport::Generate(wxDebugReport::Context_Exception);
#endif
@ -1009,7 +1004,7 @@ AudacityApp::AudacityApp()
{
// Do not capture crashes in debug builds
#if !defined(_DEBUG)
#if defined(EXPERIMENTAL_CRASH_REPORT)
#if defined(HAS_CRASH_REPORT)
#if defined(wxUSE_ON_FATAL_EXCEPTION) && wxUSE_ON_FATAL_EXCEPTION
wxHandleFatalExceptions();
#endif

View File

@ -22,10 +22,6 @@
#include <wx/app.h> // to inherit
#include <wx/timer.h> // member variable
#if defined(EXPERIMENTAL_CRASH_REPORT)
#include <wx/debugrpt.h> // for wxDebugReport::Context
#endif
#include "MemoryX.h"
class wxSingleInstanceChecker;

View File

@ -10,7 +10,7 @@
#include "CrashReport.h"
#include "Experimental.h"
#if defined(EXPERIMENTAL_CRASH_REPORT)
#if defined(HAS_CRASH_REPORT)
#include <atomic>
#include <thread>

View File

@ -12,17 +12,23 @@
#ifndef __AUDACITY_CRASH_REPORT__
#define __AUDACITY_CRASH_REPORT__
#undef HAS_CRASH_REPORT
#include "Audacity.h"
#include "Experimental.h"
#if defined(EXPERIMENTAL_CRASH_REPORT)
#include <wx/debugrpt.h>
#include <wx/setup.h> // for wxUSE* macros
#if defined(wxUSE_DEBUGREPORT) && wxUSE_DEBUGREPORT
#define HAS_CRASH_REPORT
#include <wx/debugrpt.h>
namespace CrashReport
{
namespace CrashReport
{
void Generate(wxDebugReport::Context ctx);
}
}
#endif
#endif

View File

@ -189,16 +189,9 @@
// scrolling past zero is enabled. Perhaps that lessens confusion.
#define EXPERIMENTAL_TWO_TONE_TIME_RULER
#ifndef IN_RC
// Define to include crash reporting
#define EXPERIMENTAL_CRASH_REPORT
#ifdef EXPERIMENTAL_CRASH_REPORT
#include <wx/setup.h> // for wxUSE* macros
#if !defined(wxUSE_DEBUGREPORT) || !wxUSE_DEBUGREPORT
#undef EXPERIMENTAL_CRASH_REPORT
#endif
#endif
#endif
// Define to include crash reporting, if available in wxWidgets build
// This flag is used only in CrashReport.h; elsewhere use HAS_CRASH_REPORT
#define EXPERIMENTAL_CRASH_REPORT
// Paul Licameli (PRL) 31 May 2015
// Zero-padding factor for spectrograms can smooth the display of spectrograms by

View File

@ -10,7 +10,7 @@
#include "../AudacityLogger.h"
#include "../AudioIOBase.h"
#include "../CommonCommandFlags.h"
#include "../CrashReport.h"
#include "../CrashReport.h" // for HAS_CRASH_REPORT
#include "../FileNames.h"
#include "../HelpText.h"
#include "../Menus.h"
@ -26,10 +26,6 @@
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/HelpSystem.h"
#if defined(EXPERIMENTAL_CRASH_REPORT)
#include <wx/debugrpt.h>
#endif
// private helper classes and functions
namespace {
@ -353,7 +349,7 @@ void OnShowLog( const CommandContext &context )
}
}
#if defined(EXPERIMENTAL_CRASH_REPORT)
#if defined(HAS_CRASH_REPORT)
void OnCrashReport(const CommandContext &WXUNUSED(context) )
{
// Change to "1" to test a real crash
@ -523,7 +519,7 @@ BaseItemSharedPtr HelpMenu()
#endif
Command( wxT("Log"), XXO("Show &Log..."), FN(OnShowLog),
AlwaysEnabledFlag ),
#if defined(EXPERIMENTAL_CRASH_REPORT)
#if defined(HAS_CRASH_REPORT)
Command( wxT("CrashReport"), XXO("&Generate Support Data..."),
FN(OnCrashReport), AlwaysEnabledFlag )
#endif