Pull upstream changes from TELY UI
This commit is contained in:
1 parent
7147ad52a2
commit
d5c98d5288
20 files changed
+17900
-10682
No files matched your search
+498
@@ -0,0 +1,498 @@
|
||||
#if !defined(DN_CPP_H)
|
||||
#define DN_CPP_H
|
||||
|
||||
#if defined(_CLANGD)
|
||||
#include "dn.h"
|
||||
#endif
|
||||
|
||||
#if !defined(DN_H)
|
||||
#error "Include dn.h before dn_cpp.h"
|
||||
#endif
|
||||
|
||||
// NOTE: Defaults to 1. The caller may predefine `DN_CPP 0` to keep the C array macros and skip
|
||||
// the C++ wrappers entirely.
|
||||
#if !defined(DN_CPP)
|
||||
#define DN_CPP 1
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && DN_CPP
|
||||
#define DN_DEFER const auto DN_UniqueName(defer_lambda_) = DN_DeferHelper() + [&]()
|
||||
|
||||
// NOTE: `dn.h` defines these macros in terms of `DN_Array*`. Redefine them in terms of the typed
|
||||
// `DN_TArray*` templates below.
|
||||
#undef DN_PArrayAdd
|
||||
#undef DN_PArrayAddArena
|
||||
#undef DN_PArrayAddArray
|
||||
#undef DN_PArrayAddArrayArena
|
||||
#undef DN_PArrayAddArrayHeap
|
||||
#undef DN_PArrayAddArrayPool
|
||||
#undef DN_PArrayAddHeap
|
||||
#undef DN_PArrayAddPool
|
||||
#undef DN_PArrayAppend
|
||||
#undef DN_PArrayAppendArena
|
||||
#undef DN_PArrayAppendArray
|
||||
#undef DN_PArrayAppendAssert
|
||||
#undef DN_PArrayAppendHeap
|
||||
#undef DN_PArrayAppendPool
|
||||
#undef DN_PArrayCopyPtrArena
|
||||
#undef DN_PArrayCopyPtrArenaAssert
|
||||
#undef DN_PArrayCopyPtrHeap
|
||||
#undef DN_PArrayCopyPtrHeapAssert
|
||||
#undef DN_PArrayCopyPtrPool
|
||||
#undef DN_PArrayCopyPtrPoolAssert
|
||||
#undef DN_PArrayErase
|
||||
#undef DN_PArrayEraseRange
|
||||
#undef DN_PArrayFind
|
||||
#undef DN_PArrayFindMemEq
|
||||
#undef DN_PArrayInsert
|
||||
#undef DN_PArrayInsertArray
|
||||
#undef DN_PArrayMake
|
||||
#undef DN_PArrayMakeArena
|
||||
#undef DN_PArrayMakeArenaNoZ
|
||||
#undef DN_PArrayMakeArenaZ
|
||||
#undef DN_PArrayMakeArray
|
||||
#undef DN_PArrayMakeArrayArena
|
||||
#undef DN_PArrayMakeArrayArenaNoZ
|
||||
#undef DN_PArrayMakeArrayArenaZ
|
||||
#undef DN_PArrayMakeArrayAssert
|
||||
#undef DN_PArrayMakeArrayAssertNoZ
|
||||
#undef DN_PArrayMakeArrayAssertZ
|
||||
#undef DN_PArrayMakeArrayHeap
|
||||
#undef DN_PArrayMakeArrayHeapNoZ
|
||||
#undef DN_PArrayMakeArrayHeapZ
|
||||
#undef DN_PArrayMakeArrayNoZ
|
||||
#undef DN_PArrayMakeArrayPool
|
||||
#undef DN_PArrayMakeArrayPoolNoZ
|
||||
#undef DN_PArrayMakeArrayPoolZ
|
||||
#undef DN_PArrayMakeArrayZ
|
||||
#undef DN_PArrayMakeAssert
|
||||
#undef DN_PArrayMakeAssertNoZ
|
||||
#undef DN_PArrayMakeAssertZ
|
||||
#undef DN_PArrayMakeHeap
|
||||
#undef DN_PArrayMakeHeapNoZ
|
||||
#undef DN_PArrayMakeHeapZ
|
||||
#undef DN_PArrayMakeNoZ
|
||||
#undef DN_PArrayMakePool
|
||||
#undef DN_PArrayMakePoolNoZ
|
||||
#undef DN_PArrayMakePoolZ
|
||||
#undef DN_PArrayMakeZ
|
||||
#undef DN_PArrayPopBack
|
||||
#undef DN_PArrayPopFront
|
||||
#undef DN_PArrayPrepareArena
|
||||
#undef DN_PArrayPrepareHeap
|
||||
#undef DN_PArrayPreparePool
|
||||
#undef DN_PArrayPrepend
|
||||
#undef DN_PArrayPrependArena
|
||||
#undef DN_PArrayPrependArray
|
||||
#undef DN_PArrayPrependHeap
|
||||
#undef DN_PArrayPrependPool
|
||||
#undef DN_PArrayReserveArena
|
||||
#undef DN_PArrayReserveHeap
|
||||
#undef DN_PArrayReservePool
|
||||
#undef DN_PArrayResizeArena
|
||||
#undef DN_PArrayResizeHeap
|
||||
#undef DN_PArrayResizePool
|
||||
|
||||
// NOTE: Typed array macros
|
||||
#define DN_PArrayFind(ptr, size, ptr_find, eq_func) DN_TArrayFind(ptr, size, ptr_find, eq_func)
|
||||
#define DN_PArrayFindMemEq(ptr, size, ptr_find) DN_TArrayFindMemEq(ptr, size, ptr_find)
|
||||
#define DN_PArrayResizePool(ptr, ptr_size, ptr_max, pool, new_max) DN_TArrayResizeAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), new_max)
|
||||
#define DN_PArrayResizeArena(ptr, ptr_size, ptr_max, arena, new_max) DN_TArrayResizeAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), new_max)
|
||||
#define DN_PArrayReservePool(ptr, ptr_max, pool, new_max) DN_TArrayReserveAllocator(&(ptr), ptr_max, DN_AllocatorFromPool(pool), new_max)
|
||||
#define DN_PArrayReserveArena(ptr, ptr_max, arena, new_max) DN_TArrayReserveAllocator(&(ptr), ptr_max, DN_AllocatorFromArena(arena), new_max)
|
||||
#define DN_PArrayPreparePool(ptr, size, ptr_max, pool, add_count) DN_TArrayPrepareAllocator(&(ptr), size, ptr_max, DN_AllocatorFromPool(pool), add_count)
|
||||
#define DN_PArrayPrepareArena(ptr, size, ptr_max, arena, add_count) DN_TArrayPrepareAllocator(&(ptr), size, ptr_max, DN_AllocatorFromArena(arena), add_count)
|
||||
#define DN_PArrayCopyPtrPool(dest, src, count_, pool) DN_TArrayCopyPtrAllocator(&(dest), src, count_, DN_AllocatorFromPool(pool))
|
||||
#define DN_PArrayCopyPtrPoolAssert(dest, src, count_, pool) DN_TArrayCopyPtrAllocatorAssert(&(dest), src, count_, DN_AllocatorFromPool(pool), DN_CallSiteNow)
|
||||
#define DN_PArrayCopyPtrArena(dest, src, count_, arena) DN_TArrayCopyPtrAllocator(&(dest), src, count_, DN_AllocatorFromArena(arena))
|
||||
#define DN_PArrayCopyPtrArenaAssert(dest, src, count_, arena) DN_TArrayCopyPtrAllocatorAssert(&(dest), src, count_, DN_AllocatorFromArena(arena), DN_CallSiteNow)
|
||||
|
||||
#define DN_PArrayMakeArray(ptr, ptr_size, max, count, z_mem) DN_TArrayMakeArray(ptr, ptr_size, max, count, z_mem)
|
||||
#define DN_PArrayMakeArrayZ(ptr, ptr_size, max, count) DN_TArrayMakeArray(ptr, ptr_size, max, count, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakeArrayNoZ(ptr, ptr_size, max, count) DN_TArrayMakeArray(ptr, ptr_size, max, count, DN_ZMem_No)
|
||||
#define DN_PArrayMakeArrayAssert(ptr, ptr_size, max, count, z_mem) DN_TArrayMakeArrayAssert(ptr, ptr_size, max, count, z_mem, DN_CallSiteNow)
|
||||
#define DN_PArrayMakeArrayAssertZ(ptr, ptr_size, max, count) DN_TArrayMakeArrayAssert(ptr, ptr_size, max, count, DN_ZMem_Yes, DN_CallSiteNow)
|
||||
#define DN_PArrayMakeArrayAssertNoZ(ptr, ptr_size, max, count) DN_TArrayMakeArrayAssert(ptr, ptr_size, max, count, DN_ZMem_No, DN_CallSiteNow)
|
||||
#define DN_PArrayMakeArrayArena(ptr, ptr_size, ptr_max, arena, count, z_mem) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), count, z_mem)
|
||||
#define DN_PArrayMakeArrayArenaZ(ptr, ptr_size, ptr_max, arena, count) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), count, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakeArrayArenaNoZ(ptr, ptr_size, ptr_max, arena, count) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), count, DN_ZMem_No)
|
||||
#define DN_PArrayMakeArrayPool(ptr, ptr_size, ptr_max, pool, count, z_mem) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), count, z_mem)
|
||||
#define DN_PArrayMakeArrayPoolZ(ptr, ptr_size, ptr_max, pool, count) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), count, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakeArrayPoolNoZ(ptr, ptr_size, ptr_max, pool, count) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), count, DN_ZMem_No)
|
||||
|
||||
#define DN_PArrayMake(ptr, ptr_size, max, z_mem) DN_TArrayMakeArray(ptr, ptr_size, max, 1, z_mem)
|
||||
#define DN_PArrayMakeZ(ptr, ptr_size, max) DN_TArrayMakeArray(ptr, ptr_size, max, 1, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakeNoZ(ptr, ptr_size, max) DN_TArrayMakeArray(ptr, ptr_size, max, 1, DN_ZMem_No)
|
||||
#define DN_PArrayMakeAssert(ptr, ptr_size, max, z_mem) DN_TArrayMakeArrayAssert(ptr, ptr_size, max, 1, z_mem, DN_CallSiteNow)
|
||||
#define DN_PArrayMakeAssertZ(ptr, ptr_size, max) DN_TArrayMakeArrayAssert(ptr, ptr_size, max, 1, DN_ZMem_Yes, DN_CallSiteNow)
|
||||
#define DN_PArrayMakeAssertNoZ(ptr, ptr_size, max) DN_TArrayMakeArrayAssert(ptr, ptr_size, max, 1, DN_ZMem_No, DN_CallSiteNow)
|
||||
#define DN_PArrayMakeArena(ptr, ptr_size, ptr_max, arena, z_mem) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), 1, z_mem)
|
||||
#define DN_PArrayMakeArenaZ(ptr, ptr_size, ptr_max, arena) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), 1, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakeArenaNoZ(ptr, ptr_size, ptr_max, arena) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), 1, DN_ZMem_No)
|
||||
#define DN_PArrayMakePool(ptr, ptr_size, ptr_max, pool, z_mem) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), 1, z_mem)
|
||||
#define DN_PArrayMakePoolZ(ptr, ptr_size, ptr_max, pool) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), 1, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakePoolNoZ(ptr, ptr_size, ptr_max, pool) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), 1, DN_ZMem_No)
|
||||
|
||||
#define DN_PArrayAddArray(ptr, ptr_size, max, items, count, add) DN_TArrayAddArray(ptr, ptr_size, max, items, count, add)
|
||||
#define DN_PArrayAddArrayArena(ptr, ptr_size, ptr_max, arena, items, count, add) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), items, count, add)
|
||||
#define DN_PArrayAddArrayPool(ptr, ptr_size, ptr_max, pool, items, count, add) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), items, count, add)
|
||||
#define DN_PArrayAdd(ptr, ptr_size, max, item, add) DN_TArrayAddArray(ptr, ptr_size, max, &item, 1, add)
|
||||
#define DN_PArrayAddArena(ptr, ptr_size, ptr_max, arena, item, add) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), &item, 1, add)
|
||||
#define DN_PArrayAddPool(ptr, ptr_size, ptr_max, pool, item, add) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), &item, 1, add)
|
||||
#define DN_PArrayAppendArray(ptr, ptr_size, max, items, count) DN_TArrayAddArray(ptr, ptr_size, max, items, count, DN_AddType_Append)
|
||||
#define DN_PArrayAppend(ptr, ptr_size, max, item) DN_TArrayAddArray(ptr, ptr_size, max, &item, 1, DN_AddType_Append)
|
||||
#define DN_PArrayAppendArena(ptr, ptr_size, ptr_max, arena, item) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), &item, 1, DN_AddType_Append)
|
||||
#define DN_PArrayAppendPool(ptr, ptr_size, ptr_max, pool, item) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), &item, 1, DN_AddType_Append)
|
||||
#define DN_PArrayAppendAssert(ptr, ptr_size, max, item) DN_TArrayAddArrayAssert(ptr, ptr_size, max, &item, 1, DN_AddType_Append, DN_CallSiteNow)
|
||||
#define DN_PArrayPrependArray(ptr, ptr_size, max, items, count) DN_TArrayAddArray(ptr, ptr_size, max, items, count, DN_AddType_Prepend)
|
||||
#define DN_PArrayPrepend(ptr, ptr_size, max, item) DN_TArrayAddArray(ptr, ptr_size, max, &item, 1, DN_AddType_Prepend)
|
||||
#define DN_PArrayPrependArena(ptr, ptr_size, ptr_max, arena, item) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromArena(arena), &item, 1, DN_AddType_Prepend)
|
||||
#define DN_PArrayPrependPool(ptr, ptr_size, ptr_max, pool, item) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromPool(pool), &item, 1, DN_AddType_Prepend)
|
||||
|
||||
#define DN_PArrayEraseRange(ptr, ptr_size, begin_index, count, erase) DN_TArrayEraseRange(ptr, ptr_size, begin_index, count, erase)
|
||||
#define DN_PArrayErase(ptr, ptr_size, index, erase) DN_TArrayEraseRange(ptr, ptr_size, index, 1, erase)
|
||||
#define DN_PArrayInsertArray(ptr, ptr_size, max, index, items, count) DN_TArrayInsertArray(ptr, ptr_size, max, index, items, count)
|
||||
#define DN_PArrayInsert(ptr, ptr_size, max, index, item) DN_TArrayInsertArray(ptr, ptr_size, max, index, &item, 1)
|
||||
#define DN_PArrayPopFront(ptr, ptr_size, max, count) DN_TArrayPopFront(ptr, ptr_size, count)
|
||||
#define DN_PArrayPopBack(ptr, ptr_size, max, count) DN_TArrayPopBack(ptr, ptr_size, count)
|
||||
|
||||
#define DN_PArrayResizeHeap(ptr, ptr_size, ptr_max, heap, new_max) DN_TArrayResizeAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), new_max)
|
||||
#define DN_PArrayReserveHeap(ptr, ptr_max, heap, new_max) DN_TArrayReserveAllocator(&(ptr), ptr_max, DN_AllocatorFromHeap(heap), new_max)
|
||||
#define DN_PArrayPrepareHeap(ptr, size, ptr_max, heap, add_count) DN_TArrayPrepareAllocator(&(ptr), size, ptr_max, DN_AllocatorFromHeap(heap), add_count)
|
||||
#define DN_PArrayCopyPtrHeap(dest, src, count_, heap) DN_TArrayCopyPtrAllocator(&(dest), src, count_, DN_AllocatorFromHeap(heap))
|
||||
#define DN_PArrayCopyPtrHeapAssert(dest, src, count_, heap) DN_TArrayCopyPtrAllocatorAssert(&(dest), src, count_, DN_AllocatorFromHeap(heap), DN_CallSiteNow)
|
||||
#define DN_PArrayMakeArrayHeap(ptr, ptr_size, ptr_max, heap, count, z_mem) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), count, z_mem)
|
||||
#define DN_PArrayMakeArrayHeapZ(ptr, ptr_size, ptr_max, heap, count) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), count, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakeArrayHeapNoZ(ptr, ptr_size, ptr_max, heap, count) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), count, DN_ZMem_No)
|
||||
#define DN_PArrayMakeHeap(ptr, ptr_size, ptr_max, heap, z_mem) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), 1, z_mem)
|
||||
#define DN_PArrayMakeHeapZ(ptr, ptr_size, ptr_max, heap) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), 1, DN_ZMem_Yes)
|
||||
#define DN_PArrayMakeHeapNoZ(ptr, ptr_size, ptr_max, heap) DN_TArrayMakeArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), 1, DN_ZMem_No)
|
||||
#define DN_PArrayAddArrayHeap(ptr, ptr_size, ptr_max, heap, items, count, add) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), items, count, add)
|
||||
#define DN_PArrayAddHeap(ptr, ptr_size, ptr_max, heap, item, add) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), &item, 1, add)
|
||||
#define DN_PArrayAppendHeap(ptr, ptr_size, ptr_max, heap, item) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), &item, 1, DN_AddType_Append)
|
||||
#define DN_PArrayPrependHeap(ptr, ptr_size, ptr_max, heap, item) DN_TArrayAddArrayAllocator(&(ptr), ptr_size, ptr_max, DN_AllocatorFromHeap(heap), &item, 1, DN_AddType_Prepend)
|
||||
|
||||
// NOTE: Vector operators
|
||||
inline bool operator==(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Eq(lhs, rhs); }
|
||||
inline bool operator!=(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Ne(lhs, rhs); }
|
||||
inline bool operator>=(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Ge(lhs, rhs); }
|
||||
inline bool operator<=(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Le(lhs, rhs); }
|
||||
inline bool operator<(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Lt(lhs, rhs); }
|
||||
inline bool operator>(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Gt(lhs, rhs); }
|
||||
inline DN_V2I32 operator-(DN_V2I32 lhs) { return DN_V2I32Neg(lhs); }
|
||||
inline DN_V2I32 operator-(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Sub(lhs, rhs); }
|
||||
inline DN_V2I32 operator+(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Add(lhs, rhs); }
|
||||
inline DN_V2I32 operator*(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Mul(lhs, rhs); }
|
||||
inline DN_V2I32 operator*(DN_V2I32 lhs, DN_F32 rhs) { return DN_V2I32MulF32(lhs, rhs); }
|
||||
inline DN_V2I32 operator*(DN_V2I32 lhs, DN_I32 rhs) { return DN_V2I32MulI32(lhs, rhs); }
|
||||
inline DN_V2I32 operator/(DN_V2I32 lhs, DN_V2I32 rhs) { return DN_V2I32Div(lhs, rhs); }
|
||||
inline DN_V2I32 operator/(DN_V2I32 lhs, DN_F32 rhs) { return DN_V2I32DivF32(lhs, rhs); }
|
||||
inline DN_V2I32 operator/(DN_V2I32 lhs, DN_I32 rhs) { return DN_V2I32DivI32(lhs, rhs); }
|
||||
inline DN_V2I32& operator*=(DN_V2I32& lhs, DN_V2I32 rhs) { return lhs = DN_V2I32Mul(lhs, rhs); }
|
||||
inline DN_V2I32& operator*=(DN_V2I32& lhs, DN_F32 rhs) { return lhs = DN_V2I32MulF32(lhs, rhs); }
|
||||
inline DN_V2I32& operator*=(DN_V2I32& lhs, DN_I32 rhs) { return lhs = DN_V2I32MulI32(lhs, rhs); }
|
||||
inline DN_V2I32& operator/=(DN_V2I32& lhs, DN_V2I32 rhs) { return lhs = DN_V2I32Div(lhs, rhs); }
|
||||
inline DN_V2I32& operator/=(DN_V2I32& lhs, DN_F32 rhs) { return lhs = DN_V2I32DivF32(lhs, rhs); }
|
||||
inline DN_V2I32& operator/=(DN_V2I32& lhs, DN_I32 rhs) { return lhs = DN_V2I32DivI32(lhs, rhs); }
|
||||
inline DN_V2I32& operator-=(DN_V2I32& lhs, DN_V2I32 rhs) { return lhs = DN_V2I32Sub(lhs, rhs); }
|
||||
inline DN_V2I32& operator+=(DN_V2I32& lhs, DN_V2I32 rhs) { return lhs = DN_V2I32Add(lhs, rhs); }
|
||||
|
||||
inline bool operator!=(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Ne(lhs, rhs); }
|
||||
inline bool operator==(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Eq(lhs, rhs); }
|
||||
inline bool operator>=(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Ge(lhs, rhs); }
|
||||
inline bool operator<=(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Le(lhs, rhs); }
|
||||
inline bool operator<(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Lt(lhs, rhs); }
|
||||
inline bool operator>(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Gt(lhs, rhs); }
|
||||
inline DN_V2U16 operator-(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Sub(lhs, rhs); }
|
||||
inline DN_V2U16 operator+(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Add(lhs, rhs); }
|
||||
inline DN_V2U16 operator*(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Mul(lhs, rhs); }
|
||||
inline DN_V2U16 operator*(DN_V2U16 lhs, DN_F32 rhs) { return DN_V2U16MulF32(lhs, rhs); }
|
||||
inline DN_V2U16 operator*(DN_V2U16 lhs, DN_I32 rhs) { return DN_V2U16MulI32(lhs, rhs); }
|
||||
inline DN_V2U16 operator/(DN_V2U16 lhs, DN_V2U16 rhs) { return DN_V2U16Div(lhs, rhs); }
|
||||
inline DN_V2U16 operator/(DN_V2U16 lhs, DN_F32 rhs) { return DN_V2U16DivF32(lhs, rhs); }
|
||||
inline DN_V2U16 operator/(DN_V2U16 lhs, DN_I32 rhs) { return DN_V2U16DivI32(lhs, rhs); }
|
||||
inline DN_V2U16& operator*=(DN_V2U16& lhs, DN_V2U16 rhs) { return lhs = DN_V2U16Mul(lhs, rhs); }
|
||||
inline DN_V2U16& operator*=(DN_V2U16& lhs, DN_F32 rhs) { return lhs = DN_V2U16MulF32(lhs, rhs); }
|
||||
inline DN_V2U16& operator*=(DN_V2U16& lhs, DN_I32 rhs) { return lhs = DN_V2U16MulI32(lhs, rhs); }
|
||||
inline DN_V2U16& operator/=(DN_V2U16& lhs, DN_V2U16 rhs) { return lhs = DN_V2U16Div(lhs, rhs); }
|
||||
inline DN_V2U16& operator/=(DN_V2U16& lhs, DN_F32 rhs) { return lhs = DN_V2U16DivF32(lhs, rhs); }
|
||||
inline DN_V2U16& operator/=(DN_V2U16& lhs, DN_I32 rhs) { return lhs = DN_V2U16DivI32(lhs, rhs); }
|
||||
inline DN_V2U16& operator-=(DN_V2U16& lhs, DN_V2U16 rhs) { return lhs = DN_V2U16Sub(lhs, rhs); }
|
||||
inline DN_V2U16& operator+=(DN_V2U16& lhs, DN_V2U16 rhs) { return lhs = DN_V2U16Add(lhs, rhs); }
|
||||
|
||||
inline bool operator!=(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Ne(lhs, rhs); }
|
||||
inline bool operator==(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Eq(lhs, rhs); }
|
||||
inline bool operator>=(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Ge(lhs, rhs); }
|
||||
inline bool operator<=(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Le(lhs, rhs); }
|
||||
inline bool operator<(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Lt(lhs, rhs); }
|
||||
inline bool operator>(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Gt(lhs, rhs); }
|
||||
inline DN_V2F32 operator-(DN_V2F32 lhs) { return DN_V2F32Neg(lhs); }
|
||||
inline DN_V2F32 operator-(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Sub(lhs, rhs); }
|
||||
inline DN_V2F32 operator-(DN_V2F32 lhs, DN_V2I32 rhs) { return DN_V2F32SubV2I32(lhs, rhs); }
|
||||
inline DN_V2F32 operator-(DN_V2F32 lhs, DN_F32 rhs) { return DN_V2F32SubF32(lhs, rhs); }
|
||||
inline DN_V2F32 operator-(DN_V2F32 lhs, DN_I32 rhs) { return DN_V2F32SubI32(lhs, rhs); }
|
||||
inline DN_V2F32 operator+(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Add(lhs, rhs); }
|
||||
inline DN_V2F32 operator+(DN_V2F32 lhs, DN_V2I32 rhs) { return DN_V2F32AddV2I32(lhs, rhs); }
|
||||
inline DN_V2F32 operator+(DN_V2F32 lhs, DN_F32 rhs) { return DN_V2F32AddF32(lhs, rhs); }
|
||||
inline DN_V2F32 operator+(DN_V2F32 lhs, DN_I32 rhs) { return DN_V2F32AddI32(lhs, rhs); }
|
||||
inline DN_V2F32 operator*(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Mul(lhs, rhs); }
|
||||
inline DN_V2F32 operator*(DN_V2F32 lhs, DN_V2I32 rhs) { return DN_V2F32MulV2I32(lhs, rhs); }
|
||||
inline DN_V2F32 operator*(DN_V2F32 lhs, DN_F32 rhs) { return DN_V2F32MulF32(lhs, rhs); }
|
||||
inline DN_V2F32 operator*(DN_V2F32 lhs, DN_I32 rhs) { return DN_V2F32MulI32(lhs, rhs); }
|
||||
inline DN_V2F32 operator/(DN_V2F32 lhs, DN_V2F32 rhs) { return DN_V2F32Div(lhs, rhs); }
|
||||
inline DN_V2F32 operator/(DN_V2F32 lhs, DN_V2I32 rhs) { return DN_V2F32DivV2I32(lhs, rhs); }
|
||||
inline DN_V2F32 operator/(DN_V2F32 lhs, DN_F32 rhs) { return DN_V2F32DivF32(lhs, rhs); }
|
||||
inline DN_V2F32 operator/(DN_V2F32 lhs, DN_I32 rhs) { return DN_V2F32DivI32(lhs, rhs); }
|
||||
inline DN_V2F32& operator*=(DN_V2F32& lhs, DN_V2F32 rhs) { return lhs = DN_V2F32Mul(lhs, rhs); }
|
||||
inline DN_V2F32& operator*=(DN_V2F32& lhs, DN_V2I32 rhs) { return lhs = DN_V2F32MulV2I32(lhs, rhs); }
|
||||
inline DN_V2F32& operator*=(DN_V2F32& lhs, DN_F32 rhs) { return lhs = DN_V2F32MulF32(lhs, rhs); }
|
||||
inline DN_V2F32& operator*=(DN_V2F32& lhs, DN_I32 rhs) { return lhs = DN_V2F32MulI32(lhs, rhs); }
|
||||
inline DN_V2F32& operator/=(DN_V2F32& lhs, DN_V2F32 rhs) { return lhs = DN_V2F32Div(lhs, rhs); }
|
||||
inline DN_V2F32& operator/=(DN_V2F32& lhs, DN_V2I32 rhs) { return lhs = DN_V2F32DivV2I32(lhs, rhs); }
|
||||
inline DN_V2F32& operator/=(DN_V2F32& lhs, DN_F32 rhs) { return lhs = DN_V2F32DivF32(lhs, rhs); }
|
||||
inline DN_V2F32& operator/=(DN_V2F32& lhs, DN_I32 rhs) { return lhs = DN_V2F32DivI32(lhs, rhs); }
|
||||
inline DN_V2F32& operator-=(DN_V2F32& lhs, DN_V2F32 rhs) { return lhs = DN_V2F32Sub(lhs, rhs); }
|
||||
inline DN_V2F32& operator-=(DN_V2F32& lhs, DN_V2I32 rhs) { return lhs = DN_V2F32SubV2I32(lhs, rhs); }
|
||||
inline DN_V2F32& operator-=(DN_V2F32& lhs, DN_F32 rhs) { return lhs = DN_V2F32SubF32(lhs, rhs); }
|
||||
inline DN_V2F32& operator-=(DN_V2F32& lhs, DN_I32 rhs) { return lhs = DN_V2F32SubI32(lhs, rhs); }
|
||||
inline DN_V2F32& operator+=(DN_V2F32& lhs, DN_V2F32 rhs) { return lhs = DN_V2F32Add(lhs, rhs); }
|
||||
inline DN_V2F32& operator+=(DN_V2F32& lhs, DN_V2I32 rhs) { return lhs = DN_V2F32AddV2I32(lhs, rhs); }
|
||||
inline DN_V2F32& operator+=(DN_V2F32& lhs, DN_F32 rhs) { return lhs = DN_V2F32AddF32(lhs, rhs); }
|
||||
inline DN_V2F32& operator+=(DN_V2F32& lhs, DN_I32 rhs) { return lhs = DN_V2F32AddI32(lhs, rhs); }
|
||||
|
||||
inline bool operator==(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Eq(lhs, rhs); }
|
||||
inline bool operator!=(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Ne(lhs, rhs); }
|
||||
inline bool operator>=(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Ge(lhs, rhs); }
|
||||
inline bool operator<=(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Le(lhs, rhs); }
|
||||
inline bool operator<(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Lt(lhs, rhs); }
|
||||
inline bool operator>(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Gt(lhs, rhs); }
|
||||
inline DN_V3F32 operator-(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Sub(lhs, rhs); }
|
||||
inline DN_V3F32 operator-(DN_V3F32 lhs) { return DN_V3F32Neg(lhs); }
|
||||
inline DN_V3F32 operator+(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Add(lhs, rhs); }
|
||||
inline DN_V3F32 operator*(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Mul(lhs, rhs); }
|
||||
inline DN_V3F32 operator*(DN_V3F32 lhs, DN_F32 rhs) { return DN_V3F32MulF32(lhs, rhs); }
|
||||
inline DN_V3F32 operator*(DN_V3F32 lhs, DN_I32 rhs) { return DN_V3F32MulI32(lhs, rhs); }
|
||||
inline DN_V3F32 operator/(DN_V3F32 lhs, DN_V3F32 rhs) { return DN_V3F32Div(lhs, rhs); }
|
||||
inline DN_V3F32 operator/(DN_V3F32 lhs, DN_F32 rhs) { return DN_V3F32DivF32(lhs, rhs); }
|
||||
inline DN_V3F32 operator/(DN_V3F32 lhs, DN_I32 rhs) { return DN_V3F32DivI32(lhs, rhs); }
|
||||
inline DN_V3F32& operator*=(DN_V3F32& lhs, DN_V3F32 rhs) { return lhs = DN_V3F32Mul(lhs, rhs); }
|
||||
inline DN_V3F32& operator*=(DN_V3F32& lhs, DN_F32 rhs) { return lhs = DN_V3F32MulF32(lhs, rhs); }
|
||||
inline DN_V3F32& operator*=(DN_V3F32& lhs, DN_I32 rhs) { return lhs = DN_V3F32MulI32(lhs, rhs); }
|
||||
inline DN_V3F32& operator/=(DN_V3F32& lhs, DN_V3F32 rhs) { return lhs = DN_V3F32Div(lhs, rhs); }
|
||||
inline DN_V3F32& operator/=(DN_V3F32& lhs, DN_F32 rhs) { return lhs = DN_V3F32DivF32(lhs, rhs); }
|
||||
inline DN_V3F32& operator/=(DN_V3F32& lhs, DN_I32 rhs) { return lhs = DN_V3F32DivI32(lhs, rhs); }
|
||||
inline DN_V3F32& operator-=(DN_V3F32& lhs, DN_V3F32 rhs) { return lhs = DN_V3F32Sub(lhs, rhs); }
|
||||
inline DN_V3F32& operator+=(DN_V3F32& lhs, DN_V3F32 rhs) { return lhs = DN_V3F32Add(lhs, rhs); }
|
||||
|
||||
inline bool operator==(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Eq(lhs, rhs); }
|
||||
inline bool operator!=(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Ne(lhs, rhs); }
|
||||
inline bool operator>=(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Ge(lhs, rhs); }
|
||||
inline bool operator<=(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Le(lhs, rhs); }
|
||||
inline bool operator<(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Lt(lhs, rhs); }
|
||||
inline bool operator>(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Gt(lhs, rhs); }
|
||||
inline DN_V4F32 operator-(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Sub(lhs, rhs); }
|
||||
inline DN_V4F32 operator-(DN_V4F32 lhs) { return DN_V4F32Neg(lhs); }
|
||||
inline DN_V4F32 operator+(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Add(lhs, rhs); }
|
||||
inline DN_V4F32 operator*(DN_V4F32 lhs, DN_V4F32 rhs) { return DN_V4F32Mul(lhs, rhs); }
|
||||
inline DN_V4F32 operator*(DN_V4F32 lhs, DN_F32 rhs) { return DN_V4F32MulF32(lhs, rhs); }
|
||||
inline DN_V4F32 operator*(DN_V4F32 lhs, DN_I32 rhs) { return DN_V4F32MulI32(lhs, rhs); }
|
||||
inline DN_V4F32 operator/(DN_V4F32 lhs, DN_F32 rhs) { return DN_V4F32DivF32(lhs, rhs); }
|
||||
inline DN_V4F32& operator*=(DN_V4F32& lhs, DN_V4F32 rhs) { return lhs = DN_V4F32Mul(lhs, rhs); }
|
||||
inline DN_V4F32& operator*=(DN_V4F32& lhs, DN_F32 rhs) { return lhs = DN_V4F32MulF32(lhs, rhs); }
|
||||
inline DN_V4F32& operator*=(DN_V4F32& lhs, DN_I32 rhs) { return lhs = DN_V4F32MulI32(lhs, rhs); }
|
||||
inline DN_V4F32& operator-=(DN_V4F32& lhs, DN_V4F32 rhs) { return lhs = DN_V4F32Sub(lhs, rhs); }
|
||||
inline DN_V4F32& operator+=(DN_V4F32& lhs, DN_V4F32 rhs) { return lhs = DN_V4F32Add(lhs, rhs); }
|
||||
|
||||
// NOTE: Scope helpers
|
||||
template <typename Procedure>
|
||||
struct DN_Defer
|
||||
{
|
||||
Procedure proc;
|
||||
DN_Defer(Procedure p) : proc(p) {}
|
||||
~DN_Defer() { proc(); }
|
||||
};
|
||||
|
||||
struct DN_DeferHelper
|
||||
{
|
||||
template <typename Lambda>
|
||||
DN_Defer<Lambda> operator+(Lambda lambda) { return DN_Defer<Lambda>(lambda); };
|
||||
};
|
||||
|
||||
typedef struct DN_TcScratchCpp DN_TcScratchCpp;
|
||||
struct DN_TcScratchCpp
|
||||
{
|
||||
DN_TcScratchCpp(DN_Arena **conflicts, DN_USize count);
|
||||
~DN_TcScratchCpp();
|
||||
DN_TcScratch data;
|
||||
};
|
||||
|
||||
// NOTE: Typed array (template) implementations
|
||||
template <typename T> DN_ArrayFindResult DN_TArrayFind (T *data, DN_USize count, void const *find, DN_ArrayFindEqFunc *eq_func);
|
||||
template <typename T> DN_ArrayFindResult DN_TArrayFindMemEq (T *data, DN_USize count, void const *find, DN_ArrayFindEqFunc *eq_func);
|
||||
template <typename T> T* DN_TArrayInsertArray (T *data, DN_USize *count, DN_USize max, DN_USize index, void const *items, DN_USize pop_count);
|
||||
template <typename T> T* DN_TArrayPopFront (T *data, DN_USize *count, DN_USize pop_count);
|
||||
template <typename T> T* DN_TArrayPopBack (T *data, DN_USize *count, DN_USize pop_count);
|
||||
template <typename T> DN_USize DN_TArrayEraseRange (T *data, DN_USize *count, DN_USize begin_index, DN_ISize erase_count, DN_ArrayErase erase);
|
||||
template <typename T> T* DN_TArrayMakeArray (T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_ZMem z_mem);
|
||||
template <typename T> T* DN_TArrayMakeArrayAssert (T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_ZMem z_mem, DN_CallSite call_site);
|
||||
template <typename T> T* DN_TArrayMakeArrayAssertZ (T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_CallSite call_site);
|
||||
template <typename T> T* DN_TArrayMakeArrayAssertNoZ (T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_CallSite call_site);
|
||||
template <typename T> T* DN_TArrayAddArray (T *data, DN_USize *count, DN_USize max, T const *elems, DN_USize elems_count, DN_AddType add);
|
||||
template <typename T> T* DN_TArrayAddArrayAssert (T *data, DN_USize *count, DN_USize max, T const *elems, DN_USize elems_count, DN_AddType add, DN_CallSite call_site);
|
||||
template <typename T> T* DN_TArrayMakeArrayAllocator (T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize make_count, DN_ZMem z_mem);
|
||||
template <typename T> T* DN_TArrayMakeArrayAllocatorZ (T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize make_count);
|
||||
template <typename T> T* DN_TArrayMakeArrayAllocatorNoZ (T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize make_count);
|
||||
template <typename T> T* DN_TArrayAddArrayAllocator (T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, T const *elems, DN_USize elems_count, DN_AddType add);
|
||||
template <typename T> bool DN_TArrayResizeAllocator (T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize new_max);
|
||||
template <typename T> bool DN_TArrayReserveAllocator (T **data, DN_USize *max, DN_Allocator allocator, DN_USize new_max);
|
||||
template <typename T> bool DN_TArrayPrepareAllocator (T **data, DN_USize count, DN_USize *max, DN_Allocator allocator, DN_USize add_count);
|
||||
template <typename T> DN_USize DN_TArrayCopyPtrAllocator (T **data, T const *src, DN_USize count, DN_Allocator allocator);
|
||||
template <typename T> DN_USize DN_TArrayCopyPtrAllocatorAssert(T **data, T const *src, DN_USize count, DN_Allocator allocator, DN_CallSite call_site);
|
||||
|
||||
template <typename T>
|
||||
DN_ArrayFindResult DN_TArrayFind(T *data, DN_USize count, void const *find, DN_ArrayFindEqFunc *eq_func)
|
||||
{
|
||||
DN_ArrayFindResult result = DN_ArrayFind(data, count, sizeof(*data), find, eq_func);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
DN_ArrayFindResult DN_TArrayFindMemEq(T *data, DN_USize count, void const *find)
|
||||
{
|
||||
DN_ArrayFindResult result = DN_ArrayFindMemEq(data, count, sizeof(*data), find);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayInsertArray(T *data, DN_USize *count, DN_USize max, DN_USize index, T const *items, DN_USize items_count)
|
||||
{
|
||||
T *result = DN_Cast(T *)DN_ArrayInsertArray(data, count, max, sizeof(*data), index, items, items_count);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayPopFront(T *data, DN_USize *count, DN_USize pop_count)
|
||||
{
|
||||
T *result = DN_Cast(T *)DN_ArrayPopFront(data, count, sizeof(*data), pop_count);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayPopBack(T *data, DN_USize *count, DN_USize pop_count)
|
||||
{
|
||||
T *result = DN_Cast(T *)DN_ArrayPopBack(data, count, sizeof(*data), pop_count);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
DN_USize DN_TArrayEraseRange(T *data, DN_USize *count, DN_USize begin_index, DN_ISize erase_count, DN_ArrayErase erase)
|
||||
{
|
||||
return DN_ArrayEraseRange(data, count, sizeof(*data), begin_index, erase_count, erase);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayMakeArray(T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_ZMem z_mem)
|
||||
{
|
||||
T *result = DN_Cast(T *)DN_ArrayMakeArray(data, count, max, sizeof(*data), make_count, z_mem);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayMakeArrayAssert(T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_ZMem z_mem, DN_CallSite call_site)
|
||||
{
|
||||
T *result = DN_Cast(T *)DN_ArrayMakeArrayAssert(data, count, max, sizeof(*data), make_count, z_mem, call_site);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayMakeArrayAssertZ(T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_CallSite call_site)
|
||||
{
|
||||
T* result = DN_TArrayMakeArrayAssert(data, count, max, make_count, DN_ZMem_Yes, call_site);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayMakeArrayAssertNoZ(T *data, DN_USize *count, DN_USize max, DN_USize make_count, DN_CallSite call_site)
|
||||
{
|
||||
T* result = DN_TArrayMakeArrayAssert(data, count, max, make_count, DN_ZMem_No, call_site);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayAddArray(T *data, DN_USize *count, DN_USize max, T const *elems, DN_USize elems_count, DN_AddType add)
|
||||
{
|
||||
T* result = DN_Cast(T *)DN_ArrayAddArray(data, count, max, sizeof(*elems), elems, elems_count, add);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayAddArrayAssert(T *data, DN_USize *count, DN_USize max, T const *elems, DN_USize elems_count, DN_AddType add, DN_CallSite call_site)
|
||||
{
|
||||
T* result = DN_Cast(T *)DN_ArrayAddArrayAssert(data, count, max, sizeof(*elems), elems, elems_count, add, call_site);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayMakeArrayAllocator(T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize make_count, DN_ZMem z_mem)
|
||||
{
|
||||
T *result = DN_Cast(T *)DN_ArrayMakeArrayAllocator(DN_Cast(void **)data, count, max, sizeof(**data), allocator, make_count, z_mem);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayMakeArrayAllocatorZ(T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize make_count)
|
||||
{
|
||||
T *result = DN_TArrayMakeArrayAllocator(data, count, max, allocator, make_count, DN_ZMem_Yes);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayMakeArrayAllocatorNoZ(T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize make_count)
|
||||
{
|
||||
T *result = DN_TArrayMakeArrayAllocator(data, count, max, allocator, make_count, DN_ZMem_No);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *DN_TArrayAddArrayAllocator(T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, T const *elems, DN_USize elems_count, DN_AddType add)
|
||||
{
|
||||
T *result = DN_Cast(T *)DN_ArrayAddArrayAllocator(DN_Cast(void **)data, count, max, sizeof(**data), allocator, elems, elems_count, add);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool DN_TArrayResizeAllocator(T **data, DN_USize *count, DN_USize *max, DN_Allocator allocator, DN_USize new_max)
|
||||
{
|
||||
bool result = DN_ArrayResizeAllocator(DN_Cast(void **)data, count, max, sizeof(**data), allocator, new_max);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool DN_TArrayReserveAllocator(T **data, DN_USize *max, DN_Allocator allocator, DN_USize new_max)
|
||||
{
|
||||
bool result = DN_ArrayReserveAllocator(DN_Cast(void **)data, max, sizeof(**data), allocator, new_max);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool DN_TArrayPrepareAllocator(T **data, DN_USize count, DN_USize *max, DN_Allocator allocator, DN_USize add_count)
|
||||
{
|
||||
bool result = DN_ArrayPrepareAllocator(DN_Cast(void **)data, count, max, sizeof(**data), allocator, add_count);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
DN_USize DN_TArrayCopyPtrAllocator(T **data, T const *src, DN_USize count, DN_Allocator allocator)
|
||||
{
|
||||
DN_USize result = DN_ArrayCopyPtrAllocator(DN_Cast(void **)data, src, count, sizeof(T), allocator);
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
DN_USize DN_TArrayCopyPtrAllocatorAssert(T **data, T const *src, DN_USize count, DN_Allocator allocator, DN_CallSite call_site)
|
||||
{
|
||||
DN_USize result = DN_ArrayCopyPtrAllocatorAssert(DN_Cast(void **)data, src, count, sizeof(T), allocator, call_site);
|
||||
return result;
|
||||
}
|
||||
#endif // defined(__cplusplus) && DN_CPP
|
||||
#endif // DN_CPP_H
|
||||
Reference in new issue
Block a user