From 72e4327d6af38c882fc1ba607483b307acb35a0c Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Sun, 20 Aug 2023 12:20:10 -0300 Subject: [PATCH] stl: fixes for standalone compilation --- stl/format.cpp | 1 + stl/memory.hpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/stl/format.cpp b/stl/format.cpp index e0ba76d..2f52ba9 100644 --- a/stl/format.cpp +++ b/stl/format.cpp @@ -1,6 +1,7 @@ #include "format.hpp" #include "array.hpp" +using namespace STL_NS; using namespace STL_NS::format; FormatSpec format::parse_spec(StringView str) { diff --git a/stl/memory.hpp b/stl/memory.hpp index 2b132c9..354682f 100644 --- a/stl/memory.hpp +++ b/stl/memory.hpp @@ -13,7 +13,15 @@ void memcpy(void* dest, const void* src, usize size); } +#if MAT_OS + // Placement operator new, does nothing to the pointer. -inline void* operator new(usize, void* ptr) { +inline void* operator new(usize, void* ptr) noexcept { return ptr; -} \ No newline at end of file +} + +#else + +#include + +#endif \ No newline at end of file