\r
// Remove Prefix\r
#ifdef COMMONLIB_REMOVE_PREFIX\r
-#define ASSERT c_ASSERT\r
-#define ARRAY_LEN c_ARRAY_LEN\r
+#define ASSERT C_ASSERT\r
+#define ARRAY_LEN C_ARRAY_LEN\r
\r
#define da_append c_da_append\r
#define da_free c_da_free\r
\r
\r
// Macros\r
-#define c_ASSERT(condition, msg) do {\\r
+#define C_ASSERT(condition, msg) do {\\r
if (!(condition)) {\\r
fprintf(stderr, "%s:%d:0 [ASSERTION FAILED] %s: %s", __FILE__, __LINE__, #condition, msg);\\r
exit(1);\\r
}\\r
} while (0)\r
\r
-#define c_ARRAY_LEN(arr) (sizeof(arr) / sizeof(arr[0]))\r
+#define C_ARRAY_LEN(arr) (sizeof(arr) / sizeof(arr[0]))\r
\r
#define c_shift(xs, xsz) (assert(xsz > 0 && "Array is empty"), xsz--, *xs++)\r
#define c_shift_args c_shift\r
if ((da).count >= (da).capacity) {\\r
(da).capacity *= 2;\\r
(da).items = C_REALLOC((da).items, (da).capacity * sizeof(elm));\\r
- c_ASSERT((da).items != NULL, "TODO: Log error instead of asserting");\\r
+ C_ASSERT((da).items != NULL, "TODO: Log error instead of asserting");\\r
}\\r
(da).items[(da).count++] = elm;\\r
} while (0)\r
\r
-// NOTE: We cant do c_ASSERT() here because it aint one expression...\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
#if defined(_WIN32) || defined(__CYGWIN__)\r
void c_os_get_timedate(c_Arena* a) {\r
(void)a;\r
- c_ASSERT(false, "Unimplemented!");\r
+ C_ASSERT(false, "Unimplemented!");\r
}\r
\r
bool c_os_file_exists(cstr filename) {\r
(void) filename;\r
- c_ASSERT(false, "Unimplemented!");\r
+ C_ASSERT(false, "Unimplemented!");\r
return false;\r
}\r
\r
#elif defined(__linux__)\r
void c_os_get_timedate(c_Arena* a) {\r
(void)a;\r
- c_ASSERT(false, "Unimplemented!");\r
+ C_ASSERT(false, "Unimplemented!");\r
}\r
\r
bool c_os_file_exists(cstr filename) {\r
res.buff = C_MALLOC(res.buff_size);\r
res.ptr = res.buff;\r
\r
- c_ASSERT(res.buff, "Malloc failed?");\r
+ C_ASSERT(res.buff, "Malloc failed?");\r
\r
return res;\r
}\r
\r
void* c_Arena_alloc(c_Arena* a, size_t size) {\r
- c_ASSERT(a->buff, "Bro pass an initialized arena!");\r
+ C_ASSERT(a->buff, "Bro pass an initialized arena!");\r
\r
void* res = a->ptr;\r
a->ptr = (uint8*)a->ptr + size;\r
res = a->ptr;\r
a->ptr = (uint8*)a->ptr + size;\r
}\r
- /* c_ASSERT((size_t)((uint8*)a->ptr - (uint8*)a->buff) <= a->buff_size); */\r
+ /* C_ASSERT((size_t)((uint8*)a->ptr - (uint8*)a->buff) <= a->buff_size); */\r
\r
return res;\r
}\r
bool found = false;\r
for (size_t i = 0; i < sv.count; ++i) {\r
char c = sv.data[i];\r
- for (size_t j = 0; j < c_ARRAY_LEN(hex); ++j) {\r
+ for (size_t j = 0; j < C_ARRAY_LEN(hex); ++j) {\r
if (hex[j] == c) {\r
found = true;\r
}\r