#ifndef _RTLIBC_STDLIB_H #define _RTLIBC_STDLIB_H #include <stdint.h> #include <stddef.h> #define alloca(...) __builtin_alloca(__VA_ARGS__) #define RAND_MAX UINT32_MAX #ifdef __cplusplus extern "C" { #endif void malloc_init(void *heap, size_t size, size_t alignment); size_t msize(void *p); void* malloc(size_t size); void free(void *p); uint64_t strtoul(const char *str, char **endptr, int32_t base); int64_t strtol(const char *str, char **endptr, int32_t base); int32_t atoi(const char* str); int64_t atol(const char* str); float strtof(const char *str, char **endptr); void abort(void); void srand(uint32_t seed); int32_t rand(void); void getrandom(void* buffer, size_t size); static inline int32_t abs(int32_t a) { return (a < 0) ? -a : a; } #ifdef __cplusplus } #endif #endif