Files
brightstone/Common/Std/libc.c
T
2026-10-04 11:13:07 +03:00

22 lines
599 B
C

#include "../std.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <tgmath.h>
void *com_std_alloc(void *ptr, size_t size) {
return size != 0 ? realloc(ptr, size) : (free(ptr), NULL);
}
void com_std_assert(bool holds) { assert(holds); }
void com_std_printf(char const *fmt, ...) {
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
}
double com_std_sqrt(double v) { return sqrt(v); }
double com_std_fabs(double v) { return fabs(v); }
double com_std_sin(double v) { return sin(v); }
double com_std_cos(double v) { return cos(v); }