BAN: only define placement new operators for banan-os targets

This allows building and using BAN library outside of banan-os!
This commit is contained in:
Bananymous 2024-10-10 21:55:25 +03:00
parent 44629ba5dd
commit df4f37d68d
1 changed files with 4 additions and 0 deletions

View File

@ -2,5 +2,9 @@
#include <stddef.h>
#ifdef __banan_os__
inline void* operator new(size_t, void* addr) { return addr; }
inline void* operator new[](size_t, void* addr) { return addr; }
#else
#include <new>
#endif