24 lines
606 B
C
24 lines
606 B
C
#pragma once
|
|
#include <stdint.h>
|
|
#include <stdbool.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*);
|
|
|
|
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);
|