Silence delete compile warning in memory.h/cpp on Windows

This commit is contained in:
Bastiaan Olij
2021-08-28 14:59:09 +10:00
parent dd72ce151a
commit b07559882c
2 changed files with 27 additions and 0 deletions

View File

@@ -44,6 +44,14 @@ _ALWAYS_INLINE_ void *operator new(size_t p_size, void *p_pointer, size_t check,
return p_pointer;
}
#ifdef _MSC_VER
// When compiling with VC++ 2017, the above declarations of placement new generate many irrelevant warnings (C4291).
// The purpose of the following definitions is to muffle these warnings, not to provide a usable implementation of placement delete.
void operator delete(void *p_mem, const char *p_description);
void operator delete(void *p_mem, void *(*p_allocfunc)(size_t p_size));
void operator delete(void *p_mem, void *p_pointer, size_t check, const char *p_description);
#endif
namespace godot {
class Memory {