1
0
Fork 0
tsgames/build/assets/stdlib.h

25 lines
652 B
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
extern unsigned char __heap_base;
#define IMPORT(name) __attribute__((import_module("env"), import_name(#name)))
#define EXPORT(name) __attribute__((export_name(#name)))
#define NULL ((void*)0)
typedef uint32_t size_t;
EXPORT(malloc) void* malloc(size_t);
EXPORT(free) void free(void*);
EXPORT(realloc) void* realloc(void*, size_t);
void* memset(void* s, uint8_t c, uint32_t n);
void* memcpy(void* dest, const void* src, uint32_t n);
int memcmp(const void* s1, const void* s2, uint32_t n);
IMPORT(log) void print_int(int64_t);
EXPORT(__srand) void srand(uint64_t seed);
uint64_t rand(void);