Work around placement new breakage by wx/msw/msvcrt.h
Including that header breaks any use of placement new, such as the one in wx/any.h, so we need to explicitly undefine (and then redefine it back) "new" to make it compile in case wx/msw/msvcrt.h is included first.
This commit is contained in:
parent
93c6551364
commit
6e4d0202ad
1 changed files with 10 additions and 1 deletions
|
|
@ -205,9 +205,18 @@ public:
|
|||
static void SetValue(const T& value,
|
||||
wxAnyValueBuffer& buf)
|
||||
{
|
||||
// Use placement new
|
||||
// Use placement new, taking care to avoid running into problems with
|
||||
// "new" redefinition in wx/msw/msvcrt.h.
|
||||
#ifdef WXDEBUG_NEW
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
void* const place = buf.m_buffer;
|
||||
::new(place) T(value);
|
||||
|
||||
#ifdef WXDEBUG_NEW
|
||||
#define new WXDEBUG_NEW
|
||||
#endif
|
||||
}
|
||||
|
||||
static const T& GetValue(const wxAnyValueBuffer& buf)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue