BAN: Cleanup includes

This commit is contained in:
Bananymous 2023-01-17 11:38:16 +02:00
parent a7a55cd0fb
commit cf63552b2a
9 changed files with 75 additions and 65 deletions

13
BAN/BAN/Memory.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <BAN/Memory.h>
namespace std { enum class align_val_t : size_t {}; }
void* operator new(size_t size) { return BAN::allocator(size); }
void* operator new[](size_t size) { return BAN::allocator(size); }
void* operator new(size_t size, std::align_val_t align) { return BAN::allocator_align(size, (size_t)align); }
void* operator new[](size_t size, std::align_val_t align) { return BAN::allocator_align(size, (size_t)align); }
void operator delete(void* addr) { BAN::deallocator(addr); }
void operator delete[](void* addr) { BAN::deallocator(addr); }
void operator delete(void* addr, size_t) { BAN::deallocator(addr); }
void operator delete[](void* addr, size_t) { BAN::deallocator(addr); }

View File

@ -1,5 +1,6 @@
#include <BAN/Errors.h>
#include <BAN/Math.h>
#include <BAN/Memory.h>
#include <BAN/Move.h>
#include <BAN/String.h>
#include <BAN/StringView.h>

View File

@ -31,6 +31,7 @@ BUILDDIR=$(abspath build)
FREEOBJS= \
$(ARCH_FREEOBJS) \
BAN/Memory.o \
BAN/String.o \
BAN/StringView.o \

View File

@ -1,7 +1,6 @@
#pragma once
#include <BAN/Formatter.h>
#include <BAN/Memory.h>
#include <string.h>
@ -15,6 +14,8 @@
#define TRY(error) ({ auto e = error; if (e.IsError()) return e; e.Value(); })
namespace BAN
{
class Error
{
@ -71,6 +72,7 @@ private:
bool m_has_error = false;
};
}
namespace BAN::Formatter
{

View File

@ -1,14 +1,17 @@
#pragma once
template<typename T> class ErrorOr;
#include <stddef.h>
namespace BAN
{
template<typename, size_t> class Array;
template<typename> class ErrorOr;
template<typename> class Function;
template<typename> class Queue;
class String;
class StringView;
template<typename T> class Vector;
template<typename T> class Queue;
template<typename> class Vector;
}

View File

@ -38,16 +38,5 @@ namespace BAN
}
namespace std { enum class align_val_t : size_t {}; }
inline void* operator new(size_t size) { return BAN::allocator(size); }
inline void* operator new[](size_t size) { return BAN::allocator(size); }
inline void* operator new(size_t size, std::align_val_t align) { return BAN::allocator_align(size, (size_t)align); }
inline void* operator new[](size_t size, std::align_val_t align) { return BAN::allocator_align(size, (size_t)align); }
inline void* operator new(size_t, void* addr) { return addr; }
inline void* operator new[](size_t, void* addr) { return addr; }
inline void operator delete(void* addr) { BAN::deallocator(addr); }
inline void operator delete[](void* addr) { BAN::deallocator(addr); }
inline void operator delete(void* addr, size_t) { BAN::deallocator(addr); }
inline void operator delete[](void* addr, size_t) { BAN::deallocator(addr); }

View File

@ -2,6 +2,7 @@
#include <BAN/Errors.h>
#include <BAN/Math.h>
#include <BAN/Memory.h>
#include <BAN/Move.h>
namespace BAN

View File

@ -1,6 +1,5 @@
#pragma once
#include <BAN/Errors.h>
#include <BAN/ForwardList.h>
#include <BAN/Formatter.h>

View File

@ -2,6 +2,7 @@
#include <BAN/Errors.h>
#include <BAN/Math.h>
#include <BAN/Memory.h>
#include <BAN/Move.h>
namespace BAN