update
This commit is contained in:
7
core.h
7
core.h
@@ -60,6 +60,7 @@ void *pushSize(Arena *arena, size_t bytes);
|
||||
Arena *arenaAlloc(size_t capacity);
|
||||
void arenaFree(Arena *arena);
|
||||
void arenaFreeFrom(Arena *arena, size_t pos);
|
||||
void arenaPopTo(Arena *arena, void *pos);
|
||||
|
||||
void initialiseCore();
|
||||
|
||||
@@ -150,7 +151,7 @@ struct string {
|
||||
|
||||
#define strlit(lit) (string{(char *)(lit), sizeof(lit) - 1})
|
||||
#define PushString(arena, length) (string{ (char *)pushSize(arena, length), (length) })
|
||||
string operator""_s(const char *cstrLiteral, unsigned long length);
|
||||
string operator""_s(const char *cstrLiteral, size_t length);
|
||||
|
||||
// C Strings
|
||||
const char *cstring(Arena *arena, list<char> buf);
|
||||
@@ -209,8 +210,8 @@ void log(const char *fmt, ...);
|
||||
void logError(const char *fmt, ...);
|
||||
|
||||
// ### Loops ###
|
||||
#define EachIn(list, it) size_t it = 0; it < list.length; it++
|
||||
#define EachInReversed(list, it) size_t it = list.length - 1; it >= 0 && it < list.length; it--
|
||||
#define EachIn(list, it) size_t it = 0; it < (list).head; it++
|
||||
#define EachInReversed(list, it) size_t it = (list).head - 1; it >= 0 && it < (list).head; it--
|
||||
#define EachInArray(arr, it) size_t it = 0; it < ArrayCount(arr); ++it
|
||||
|
||||
// ### Misc ###
|
||||
|
||||
Reference in New Issue
Block a user