mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-20 21:28:03 +00:00
interim commit
This commit is contained in:
parent
3dffbea2a3
commit
b678249cbe
File diff suppressed because one or more lines are too long
@ -3,5 +3,5 @@
|
||||
// NOTE: This file only exists to make sure that clay works when included in multiple translation units.
|
||||
|
||||
void SatisfyCompiler() {
|
||||
CLAY_CONTAINER(CLAY_ID("SatisfyCompiler"), CLAY_LAYOUT()) {}
|
||||
CLAY(CLAY_ID("SatisfyCompiler"), CLAY_LAYOUT()) {}
|
||||
}
|
3
generator/array_allocate.template.c
Normal file
3
generator/array_allocate.template.c
Normal 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)};
|
||||
}
|
@ -4,7 +4,3 @@ typedef struct
|
||||
uint32_t length;
|
||||
$TYPE$ *internalArray;
|
||||
} $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)};
|
||||
}
|
5
generator/array_define_slice.template.c
Normal file
5
generator/array_define_slice.template.c
Normal file
@ -0,0 +1,5 @@
|
||||
typedef struct
|
||||
{
|
||||
uint32_t length;
|
||||
$TYPE$ *internalArray;
|
||||
} $NAME$Slice;
|
3
generator/array_get_slice.template.c
Normal file
3
generator/array_get_slice.template.c
Normal 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$;
|
||||
}
|
Loading…
Reference in New Issue
Block a user