interim commit

This commit is contained in:
Nic Barker 2024-10-01 07:46:41 +13:00
parent 3dffbea2a3
commit b678249cbe
7 changed files with 1039 additions and 1100 deletions

2018
clay.h

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -3,5 +3,5 @@
// NOTE: This file only exists to make sure that clay works when included in multiple translation units. // NOTE: This file only exists to make sure that clay works when included in multiple translation units.
void SatisfyCompiler() { void SatisfyCompiler() {
CLAY_CONTAINER(CLAY_ID("SatisfyCompiler"), CLAY_LAYOUT()) {} CLAY(CLAY_ID("SatisfyCompiler"), CLAY_LAYOUT()) {}
} }

View File

@ -0,0 +1,3 @@
$NAME$ $NAME$_Allocate_Arena(uint32_t capacity, Clay_Arena *arena) {
return CLAY__INIT($NAME$){.capacity = capacity, .length = 0, .internalArray = ($TYPE$ *)Clay__Array_Allocate_Arena(capacity, sizeof($TYPE$), CLAY__ALIGNMENT($TYPE$), arena)};
}

View File

@ -4,7 +4,3 @@ typedef struct
uint32_t length; uint32_t length;
$TYPE$ *internalArray; $TYPE$ *internalArray;
} $NAME$; } $NAME$;
$NAME$ $NAME$_Allocate_Arena(uint32_t capacity, Clay_Arena *arena) {
return CLAY__INIT($NAME$){.capacity = capacity, .length = 0, .internalArray = ($TYPE$ *)Clay__Array_Allocate_Arena(capacity, sizeof($TYPE$), CLAY__ALIGNMENT($TYPE$), arena)};
}

View File

@ -0,0 +1,5 @@
typedef struct
{
uint32_t length;
$TYPE$ *internalArray;
} $NAME$Slice;

View File

@ -0,0 +1,3 @@
$TYPE$ *$NAME$Slice_Get($NAME$Slice *slice, int index) {
return Clay__Array_RangeCheck(index, slice->length) ? &slice->internalArray[index] : $DEFAULT_VALUE$;
}