rename ifdefs

This commit is contained in:
2025-12-01 19:24:12 +01:00
parent fa156d2084
commit 58534670f8
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
// This is used to have a single file that implements the allocators when all // This is used to have a single file that implements the allocators when all
// the test files are compiled together. // the test files are compiled together.
#define ALLOCATOR_IMPLEMENTATION #define CIG_IMPL
#include "cig.h" #include "cig.h"
+5 -5
View File
@@ -1,5 +1,5 @@
#ifndef ALLOCATOR_H #ifndef CIG_H
#define ALLOCATOR_H #define CIG_H
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
@@ -242,7 +242,7 @@ void dyn_array_destroy(void *this);
#define dyn_array_pop(THIS) (dyn_array_shrink(THIS, 1), THIS[dyn_array_length(THIS)]) #define dyn_array_pop(THIS) (dyn_array_shrink(THIS, 1), THIS[dyn_array_length(THIS)])
#ifdef ALLOCATOR_IMPLEMENTATION #ifdef CIG_IMPL
void *allocator_alloc_func(allocator_t this, size_t bytes, const char *file, int line) { void *allocator_alloc_func(allocator_t this, size_t bytes, const char *file, int line) {
return this.vtbl->alloc(this.this, bytes, file, line); return this.vtbl->alloc(this.this, bytes, file, line);
@@ -260,5 +260,5 @@ void allocator_free_func(allocator_t this, void *ptr, const char *file, int line
#include "dyn_array.c" #include "dyn_array.c"
#include "arena_allocator.c" #include "arena_allocator.c"
#endif // ALLOCATOR_IMPLEMENTATION #endif // CIG_IMPL
#endif // ALLOCATOR_H #endif // CIG_H
+1 -1
View File
@@ -1,4 +1,4 @@
#define ALLOCATOR_IMPLEMENTATION #define CIG_IMPL
#include "cig.h" #include "cig.h"
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>