Skip to content

Commit

Permalink
stl: fixes for standalone compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Aug 20, 2023
1 parent b8afb6b commit 72e4327
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions stl/format.cpp
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
12 changes: 10 additions & 2 deletions stl/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

#else

#include <new>

#endif

0 comments on commit 72e4327

Please sign in to comment.