Added math.h, stdlib.h, float.h, and stbool.h to std folder (and all their implementations). Opted to NOT implement malloc/free/etc. in favor of having our own functions init_mem, grow_mem, and get_mem.

This commit is contained in:
Taylor Robbins (Piggybank Studios)
2025-08-28 13:20:08 -07:00
parent deae3ccd12
commit d0aa7a1d0e
13 changed files with 4868 additions and 2 deletions

12
cwasm.h
View File

@@ -31,6 +31,9 @@ Description:
#error This standard library implementation assumes little-endian byte order
#endif
// +--------------------------------------------------------------+
// | Macros |
// +--------------------------------------------------------------+
#ifdef __cplusplus
#define LANGUAGE_IS_C 0
#define LANGUAGE_IS_CPP 1
@@ -66,8 +69,17 @@ Description:
// | Standard Includes |
// +--------------------------------------------------------------+
// NOTE: These headers are all contained in CWasm's "std" folder, they are not "real" C standard library headers
#include <limits.h>
#include <stdint.h>
#include <uchar.h>
#include <float.h>
#include <stdbool.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stddef.h>
#include <assert.h>
#include <math.h>
// +--------------------------------------------------------------+
// | Basic Type Names |