]> www.git.momoyon.org Git - commonlib.git/commitdiff
[commonlib.h] c_ASSERT -> assert in c_da_shift.
authorahmedsamyh <ahmedsamyh10@gmail.com>
Tue, 4 Mar 2025 18:55:24 +0000 (23:55 +0500)
committerahmedsamyh <ahmedsamyh10@gmail.com>
Tue, 4 Mar 2025 18:55:24 +0000 (23:55 +0500)
commonlib.h

index d7c442a642ef5194fcd6b951cb36f9f2c4a61826..fbaa50c70904a796d95dea30ebf9d58b754a3e53 100644 (file)
@@ -175,7 +175,8 @@ typedef struct c_Arena c_Arena;
                (da).items[(da).count++] = elm;\\r
        } while (0)\r
 \r
-#define c_da_shift(da) (c_ASSERT(da.count > 0, "Array is empty"), da.count--, *da.items++)\r
+// NOTE: We cant do c_ASSERT() here because it aint one expression...\r
+#define c_da_shift(da) (assert(da.count > 0 && "Array is empty"), da.count--, *da.items++)\r
 #define c_da_free(da) C_FREE(da.items)\r
 \r
 //\r
@@ -296,6 +297,7 @@ bool c_sv_equals(c_String_view sv1, c_String_view sv2);
 #include <string.h>\r
 #include <errno.h>\r
 #include <stdlib.h>\r
+#include <assert.h>\r
 \r
 // My things implementation:\r
 \r