Change to C99 and add weak references

This commit is contained in:
2025-09-05 20:01:36 -07:00
parent 4efdcc97ae
commit 12e3923938
8 changed files with 295 additions and 51 deletions

View File

@ -8,7 +8,7 @@
#include <stdlib.h>
#include <string.h>
#if __has_attribute(unused)
#if defined(__has_attribute) && __has_attribute(unused)
# define UNUSED __attribute__((unused))
#else
# define UNUSED
@ -67,8 +67,8 @@ static UNUSED char *counting_strdup(const char *str) {
}
static UNUSED const RefcountAllocator COUNTING_ALLOCATOR = {
.malloc = counting_malloc,
.free = counting_free,
.malloc.no_data = counting_malloc,
.free.no_data = counting_free,
};
#endif