From f8ef11b4d25203e2a5b5fac770e9f0bb9829ec5e Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 19 Nov 2024 00:16:44 +0200 Subject: [PATCH] BAN: Make PlacementNew.h only include if it exists Otherwise it will define the functions itself. This allows compiling toolchain as stdlibc++ depends on BAN. --- BAN/include/BAN/PlacementNew.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/BAN/include/BAN/PlacementNew.h b/BAN/include/BAN/PlacementNew.h index 30c48c5f..828a8e5b 100644 --- a/BAN/include/BAN/PlacementNew.h +++ b/BAN/include/BAN/PlacementNew.h @@ -1,3 +1,10 @@ #pragma once -#include +#if __has_include() + #include +#else + #include + + inline void* operator new(size_t, void* addr) { return addr; } + inline void* operator new[](size_t, void* addr) { return addr; } +#endif