Commit c7cc303

kravantokh <kravantokh@noreply.codeberg.org>
2026-08-11 00:43:31
Fix STRUCT macro to not include semicolon.
1 parent aac1c36
Changed files (5)
datatypes
memory
platform
datatypes/string.h
@@ -6,7 +6,7 @@
 STRUCT( Str,
 	usize len;
 	u8 data[];
-)
+);
 
 
 /* On typical platforms that already have/need nul-termination we keep the nul-termination alongside the explicit length notation.
memory/arena.h
@@ -9,7 +9,7 @@ STRUCT( Arena,
 	usize claimed;  /* Total size of the arena */
 	usize occupied; /* The actually occupied (backed) range */
 	usize taken;    /* The top of the arena */
-)
+);
 
 Status Arena_create( Arena *out, usize size );
 Status Arena_destroy( Arena *a );
memory/heap.h
@@ -8,12 +8,12 @@ STRUCT( HeapEntry,
 	usize size;
 	struct _HeapEntry *next;
 	u8 data[]; /* The above pointer should gives a sane alignment here despite this being u8 */
-)
+);
 
 STRUCT( Heap,
 	Arena arena; /* Heap is built on top of arena. It's just an arena + a freelist with metadata */
 	HeapEntry *freelist;
-)
+);
 
 Status Heap_create( Heap *out, usize size ); /* size - size of underlying arena. The heap will hold less, due to bookkeeping overhead for allocations. */
 
platform/info/compiler.h
@@ -111,7 +111,7 @@
 #define STRUCT( name, ...) \
 typedef struct _##name { \
 	__VA_ARGS__ \
-} name;
+} name
 
 /* Cross-compiler packed struct declarator */
 #if COMPILER == COMPILER_GCC || COMPILER == COMPILER_CLANG || COMPILER == COMPILER_TCC
platform/linux/file.h
@@ -12,7 +12,7 @@
 
 STRUCT( File,
 	s32 fd;
-)
+);
 
 STRUCT( FileView,
 	File file;
@@ -20,7 +20,7 @@ STRUCT( FileView,
 	usize claimed;
 	usize filesize;
 	usize flags;
-)
+);
 
 Status File_open( const Str *name, usize flags, File *out ) {
 	DEBUG( assert( name->data[name->len] == 0 ) );