1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-02 08:59:28 +02:00

Remove wx/any.h from MemoryX.h; sacrifice MSVC debug new macro ...

... it never helped us debug much, and polluted the preprocessor namespace and
made this bad depencency
This commit is contained in:
Paul Licameli 2021-02-17 12:37:19 -05:00
parent 434f3919f9
commit 094675bd42

View File

@ -138,17 +138,6 @@ public:
with *, ->, reset(), or in if()
*/
// Placement-NEW is used below, and that does not cooperate with the DEBUG_NEW for Visual Studio
#ifdef _DEBUG
#ifdef _MSC_VER
#undef new
// wx/any.h also uses Placement-NEW so include it before redefining "new" at comment:
// "Restore definition of debug new"
#include <wx/any.h>
#endif
#endif
template<typename X>
class Optional {
public:
@ -265,15 +254,6 @@ private:
X* pp{ nullptr };
};
// Restore definition of debug new
#ifdef _DEBUG
#ifdef _MSC_VER
#undef THIS_FILE
static const char THIS_FILE[] = __FILE__;
#define new new(_NORMAL_BLOCK, THIS_FILE, __LINE__)
#endif
#endif
/**
A deleter for pointers obtained with malloc
*/