Skip to content

Commit

Permalink
Add a matching placement delete for placement new
Browse files Browse the repository at this point in the history
Even though it is a no-op this is good style and avoids a warning with
MSVC.

Fix recastnavigation#359
  • Loading branch information
jakobbotsch committed Nov 5, 2018
1 parent fe4d439 commit 3087e80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions Recast/Include/RecastAlloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 (!!!).
Expand Down
3 changes: 1 addition & 2 deletions RecastDemo/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3087e80

Please sign in to comment.