From f54fb58537d59f1fa9ae2b4191c699d049e2e9e6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Nov 2022 08:41:58 +0000 Subject: [PATCH] Linux fixes --- gamestate.c | 2 +- queue.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gamestate.c b/gamestate.c index da01ec1..2288b3c 100644 --- a/gamestate.c +++ b/gamestate.c @@ -22,7 +22,7 @@ enum BOXES = 1 << 1, }; -void __assert(bool cond, const char *file, int line, const char *cond_string) +void __flight_assert(bool cond, const char *file, int line, const char *cond_string) { if (!cond) { diff --git a/queue.h b/queue.h index 57f8575..7c9badd 100644 --- a/queue.h +++ b/queue.h @@ -3,7 +3,7 @@ #include #ifndef QUEUE_ASSERT -void __assert(bool cond, const char *file, int line, const char *cond_string); +void __flight_assert(bool cond, const char *file, int line, const char *cond_string); #define QUEUE_ASSERT(condition) __assert(condition, __FILE__, __LINE__, #condition) #endif @@ -53,7 +53,7 @@ void queue_clear(Queue *q) q->next = NULL; } -#define QUEUE_ELEM_ITER(cur) for (QueueElementHeader *cur = (QueueElementHeader *)q->data; (char *)cur < q->data + q->data_length; (char *)cur += (sizeof(QueueElementHeader) + q->element_size)) +#define QUEUE_ELEM_ITER(cur) for (QueueElementHeader *cur = (QueueElementHeader *)q->data; (char *)cur < q->data + q->data_length; cur = (QueueElementHeader*)((char*)cur + (sizeof(QueueElementHeader) + q->element_size))) // you push an element, get the return value, cast it to your type, and fill it with data. It's that easy! // if it's null the queue is out of space