BAN: Make PlacementNew.h only include <new> if it exists

Otherwise it will define the functions itself. This allows compiling
toolchain as stdlibc++ depends on BAN.
This commit is contained in:
Bananymous 2024-11-19 00:16:44 +02:00
parent 71563034a7
commit f8ef11b4d2
1 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,10 @@
#pragma once #pragma once
#include <new> #if __has_include(<new>)
#include <new>
#else
#include <stddef.h>
inline void* operator new(size_t, void* addr) { return addr; }
inline void* operator new[](size_t, void* addr) { return addr; }
#endif