refactor, libc made optional

This commit is contained in:
veclavtlica
2026-09-14 12:21:49 +03:00
parent 26f6ba56e9
commit 1125073568
14 changed files with 178 additions and 152 deletions
+19 -3
View File
@@ -1,4 +1,20 @@
/*
Minimal subset of stdlib, none of which have to be actually implemented,
even memory mnagement.
*/
/* TODO: Actually implement. */
#define realloc(m_p, m_b) (NULL)
#define free(m_p) ((void)0)
#include <stdbool.h>
#include <stddef.h>
extern void *com_std_realloc(void *ptr, size_t size);
extern void com_std_free(void *ptr);
/* Note: Functions listed below are only available for test builds. */
/* Trigonometry functions are for reference testing of our own fixed point
* implementations. Do not use otherwise. */
extern void com_std_assert(bool holds);
extern void com_std_printf(char const *fmt, ...);
extern double com_std_sqrt(double v);
extern double com_std_fabs(double v);
extern double com_std_sin(double v);
extern double com_std_cos(double v);