1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-03 01:19:24 +02:00

Convert all __WXDEBUG__ tests to use new _DEBUG symbol

This symbol is based on the NDEBUG symbol that's automatically
defined by CMake.
This commit is contained in:
Leland Lucius 2020-04-25 02:36:27 -05:00
parent ef28b9214b
commit 1ca911ed38
12 changed files with 22 additions and 16 deletions

View File

@ -706,10 +706,10 @@ void AboutDialog::PopulateInformationPage( ShuttleGui & S )
AddBuildinfoRow(&informationStr, XO("Commit Id:"), REV_IDENT );
auto buildType =
#ifdef __WXDEBUG__
XO("Debug build")
#ifdef _DEBUG
XO("Debug build (debug level %d)").Format(wxDEBUG_LEVEL);
#else
XO("Release build")
XO("Release build (debug level %d)").Format(wxDEBUG_LEVEL);
#endif
;
if( (sizeof(void*) == 8) )

View File

@ -236,5 +236,11 @@ class wxWindow;
#define RTL_WORKAROUND( pWnd )
#endif
// Define/undefine _DEBUG based on the (CMake provided) NDEBUG symbol
#if defined(NDEBUG)
#undef _DEBUG
#else
#define _DEBUG 1
#endif
#endif // __AUDACITY_H__

View File

@ -1182,7 +1182,7 @@ bool AudacityApp::OnExceptionInMainLoop()
AudacityApp::AudacityApp()
{
// Do not capture crashes in debug builds
#if !defined(__WXDEBUG__)
#if !defined(_DEBUG)
#if defined(EXPERIMENTAL_CRASH_REPORT)
#if defined(wxUSE_ON_FATAL_EXCEPTION) && wxUSE_ON_FATAL_EXCEPTION
wxHandleFatalExceptions();

View File

@ -725,7 +725,7 @@ void Envelope::Cap( double sampleDur )
*/
int Envelope::InsertOrReplaceRelative(double when, double value)
{
#if defined(__WXDEBUG__)
#if defined(_DEBUG)
// in debug builds, do a spot of argument checking
if(when > mTrackLen + 0.0000001)
{

View File

@ -38,7 +38,7 @@ extern AUDACITY_DLL_API const wxString& GetCustomSubstitution(const wxString& st
#undef _
#endif
#if defined( __WXDEBUG__ )
#if defined( _DEBUG )
// Force a crash if you misuse _ in a static initializer, so that translation
// is looked up too early and not found.

View File

@ -1220,7 +1220,7 @@ void MenuCreator::CreateMenusAndCommands(AudacityProject &project)
mLastFlags = AlwaysEnabledFlag;
#if defined(__WXDEBUG__)
#if defined(_DEBUG)
// c->CheckDups();
#endif
}
@ -1277,7 +1277,7 @@ void MenuCreator::RebuildMenuBar(AudacityProject &project)
// On OSX, we can't rebuild the menus while a modal dialog is being shown
// since the enabled state for menus like Quit and Preference gets out of
// sync with wxWidgets idea of what it should be.
#if defined(__WXMAC__) && defined(__WXDEBUG__)
#if defined(__WXMAC__) && defined(_DEBUG)
{
wxDialog *dlg =
wxDynamicCast(wxGetTopLevelParent(wxWindow::FindFocus()), wxDialog);

View File

@ -726,7 +726,7 @@ CommandListEntry *CommandManager::NewIdentifier(const CommandID & nameIn,
CommandListEntry *entry = &*mCommandList.back();
mCommandNumericIDHash[entry->id] = entry;
#if defined(__WXDEBUG__)
#if defined(_DEBUG)
prev = mCommandNameHash[entry->name];
if (prev) {
// Under Linux it looks as if we may ask for a newID for the same command
@ -1476,7 +1476,7 @@ void CommandManager::SetCommandFlags(const CommandID &name,
entry->flags = flags;
}
#if defined(__WXDEBUG__)
#if defined(_DEBUG)
void CommandManager::CheckDups()
{
int cnt = mCommandList.size();

View File

@ -286,7 +286,7 @@ class AUDACITY_DLL_API CommandManager final
bool GetEnabled(const CommandID &name);
int GetNumberOfKeysRead() const;
#if defined(__WXDEBUG__)
#if defined(_DEBUG)
void CheckDups();
#endif
void RemoveDuplicateShortcuts();

View File

@ -1177,7 +1177,7 @@ GStreamerImportFileHandle::ProcessBusMessage(bool & success)
return cont;
}
#if defined(__WXDEBUG__)
#if defined(_DEBUG)
{
GstString objname;
if (msg->src != NULL)

View File

@ -71,7 +71,7 @@ void BatchPrefs::PopulateOrExchange( ShuttleGui & S )
S.StartStatic( XO("Behaviors"),1 );
{
#ifdef __WXDEBUG__
#ifdef _DEBUG
S.TieCheckBox( XO("&Don't apply effects in batch mode"),
{wxT("/Batch/Debug"), false});
#endif

View File

@ -214,7 +214,7 @@ void LibraryPrefs::OnFFmpegFindButton(wxCommandEvent & WXUNUSED(event))
#ifdef USE_FFMPEG
FFmpegLibs* FFmpegLibsPtr = PickFFmpegLibs();
bool showerrs =
#if defined(__WXDEBUG__)
#if defined(_DEBUG)
true;
#else
false;

View File

@ -116,7 +116,7 @@ void ThemePrefs::PopulateOrExchange(ShuttleGui & S)
"Themability is an experimental feature.\n\nTo try it out, click \"Save Theme Cache\" then find and modify the images and colors in\nImageCacheVxx.png using an image editor such as the Gimp.\n\nClick \"Load Theme Cache\" to load the changed images and colors back into Audacity.\n\n(Only the Transport Toolbar and the colors on the wavetrack are currently affected, even\nthough the image file shows other icons too.)")
);
#ifdef __WXDEBUG__
#ifdef _DEBUG
S.AddFixedText(
Verbatim(
"This is a debug version of Audacity, with an extra button, 'Output Sourcery'. This will save a\nC version of the image cache that can be compiled in as a default.")
@ -142,7 +142,7 @@ void ThemePrefs::PopulateOrExchange(ShuttleGui & S)
// This next button is only provided in Debug mode.
// It is for developers who are compiling Audacity themselves
// and who wish to generate a NEW ThemeAsCeeCode.h and compile it in.
#ifdef __WXDEBUG__
#ifdef _DEBUG
S.Id(idSaveThemeAsCode).AddButton(Verbatim("Output Sourcery"));
#endif