summaryrefslogtreecommitdiff
path: root/lib/nes/common
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-07 12:32:16 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-07 12:32:16 +0100
commite39508e6f2bac8ae171b496bc3ece7eaa2e63114 (patch)
treea6fccec79819e09aab989a49e1e53fc7cb4ea86e /lib/nes/common
parent8fd56566520ae93bda64fe335cef9202388c6364 (diff)
fix warnings
Diffstat (limited to 'lib/nes/common')
-rw-r--r--lib/nes/common/containers/box.hh1
-rw-r--r--lib/nes/common/debug.hh4
-rw-r--r--lib/nes/common/utils.hh13
3 files changed, 16 insertions, 2 deletions
diff --git a/lib/nes/common/containers/box.hh b/lib/nes/common/containers/box.hh
index 82f6448..b34958d 100644
--- a/lib/nes/common/containers/box.hh
+++ b/lib/nes/common/containers/box.hh
@@ -3,7 +3,6 @@
#include "nes/common/types.hh"
#include "nes/common/debug.hh"
#include "nes/common/utils.hh"
-#include <new>
namespace nes
{
diff --git a/lib/nes/common/debug.hh b/lib/nes/common/debug.hh
index 30370e9..a7a0854 100644
--- a/lib/nes/common/debug.hh
+++ b/lib/nes/common/debug.hh
@@ -21,7 +21,11 @@
#else
+#ifdef NES_HAS_STDLIB
#include <cassert>
+#else
+#include "debug/assert.h"
+#endif
#define NES_ASSERT(...) \
assert(__VA_ARGS__)
diff --git a/lib/nes/common/utils.hh b/lib/nes/common/utils.hh
index 460d0d5..9a6194a 100644
--- a/lib/nes/common/utils.hh
+++ b/lib/nes/common/utils.hh
@@ -35,4 +35,15 @@ namespace nes
a = b;
b = tmp;
}
-} // namespace nes \ No newline at end of file
+} // namespace nes
+
+#ifdef NES_HAS_STDLIB
+
+#include <new>
+
+#else
+
+// Placement new is an API-defined operator for some reason!?
+inline void* operator new(decltype(sizeof(int)), void* ptr) { return ptr; }
+
+#endif \ No newline at end of file