diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index f540cb1a6..97ce319fb 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -29,6 +29,7 @@ It handles initialization and termination by subclassing wxApp. #include // for wxUSE_* macros #include #include +#include #include #include #include @@ -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 -#include -#include -#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 diff --git a/src/AudacityApp.h b/src/AudacityApp.h index de84c5dc6..66e867fb5 100644 --- a/src/AudacityApp.h +++ b/src/AudacityApp.h @@ -22,10 +22,6 @@ #include // to inherit #include // member variable -#if defined(EXPERIMENTAL_CRASH_REPORT) -#include // for wxDebugReport::Context -#endif - #include "MemoryX.h" class wxSingleInstanceChecker; diff --git a/src/AudacityLogger.cpp b/src/AudacityLogger.cpp index c94200d46..7b2d5a102 100644 --- a/src/AudacityLogger.cpp +++ b/src/AudacityLogger.cpp @@ -318,4 +318,4 @@ void AudacityLogger::UpdatePrefs() Show(true); } } -} \ No newline at end of file +} diff --git a/src/CrashReport.cpp b/src/CrashReport.cpp index 0f409d798..c9007f967 100644 --- a/src/CrashReport.cpp +++ b/src/CrashReport.cpp @@ -10,7 +10,7 @@ #include "CrashReport.h" #include "Experimental.h" -#if defined(EXPERIMENTAL_CRASH_REPORT) +#if defined(HAS_CRASH_REPORT) #include #include diff --git a/src/CrashReport.h b/src/CrashReport.h index 1f4afca74..4022ebfba 100644 --- a/src/CrashReport.h +++ b/src/CrashReport.h @@ -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 +#include // for wxUSE* macros +#if defined(wxUSE_DEBUGREPORT) && wxUSE_DEBUGREPORT + #define HAS_CRASH_REPORT + #include -namespace CrashReport -{ - void Generate(wxDebugReport::Context ctx); -} + namespace CrashReport + { + void Generate(wxDebugReport::Context ctx); + } +#endif #endif diff --git a/src/Experimental.h b/src/Experimental.h index 223e9f977..208c8c6cb 100644 --- a/src/Experimental.h +++ b/src/Experimental.h @@ -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 // 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 diff --git a/src/menus/HelpMenus.cpp b/src/menus/HelpMenus.cpp index 136327b1f..0612181eb 100644 --- a/src/menus/HelpMenus.cpp +++ b/src/menus/HelpMenus.cpp @@ -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 -#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