Add a matching placement delete for placement new

Even though it is a no-op this is good style and avoids a warning with
MSVC.

Fix #359
This commit is contained in:
Jakob Botsch Nielsen 2018-11-05 14:01:29 +01:00
parent fe4d4392a6
commit 3087e805b0
2 changed files with 2 additions and 2 deletions

View File

@ -66,6 +66,7 @@ void rcFree(void* ptr);
/// and STL.
struct rcNewTag {};
inline void* operator new(size_t, const rcNewTag&, void* p) { return p; }
inline void operator delete(void*, const rcNewTag&, void*) {}
/// Signed to avoid warnnings when comparing to int loop indexes, and common error with comparing to zero.
/// MSVC2010 has a bug where ssize_t is unsigned (!!!).

View File

@ -41,8 +41,7 @@ solution "recastnavigation"
-- warnings "Extra" uses /W4 which is too aggressive for us, so use W3 instead.
-- Disable:
-- * C4351: new behavior for array initialization
-- * C4291: no matching operator delete found; we don't use exceptions, so doesn't matter
buildoptions { "/W3", "/wd4351", "/wd4291" }
buildoptions { "/W3", "/wd4351" }
filter "platforms:Win32"
architecture "x32"