From faa7e7649e25e6f25f56be3bec5cd5ffd741e511 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 16 Dec 2023 11:47:15 +0000 Subject: Extract primitives{.h,.c} --- runtime/src/patio/patio.h | 2 ++ runtime/src/primitives.c | 3 +++ runtime/src/primitives.h | 10 ++++++++++ runtime/src/shed.c | 2 -- runtime/src/shed.h | 4 +--- 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 runtime/src/primitives.c create mode 100644 runtime/src/primitives.h (limited to 'runtime/src') diff --git a/runtime/src/patio/patio.h b/runtime/src/patio/patio.h index 93af56d0..c91f66f4 100644 --- a/runtime/src/patio/patio.h +++ b/runtime/src/patio/patio.h @@ -1,6 +1,8 @@ #ifndef SHED_PATIO_PATIO_H #define SHED_PATIO_PATIO_H +#include "../std.h" + #ifdef __WASM__ typedef uint32_t PatioInt; #else diff --git a/runtime/src/primitives.c b/runtime/src/primitives.c new file mode 100644 index 00000000..a103ba6d --- /dev/null +++ b/runtime/src/primitives.c @@ -0,0 +1,3 @@ +#include "./primitives.h" + +ShedObject const shed_unit = 0; diff --git a/runtime/src/primitives.h b/runtime/src/primitives.h new file mode 100644 index 00000000..25bcbf5c --- /dev/null +++ b/runtime/src/primitives.h @@ -0,0 +1,10 @@ +#ifndef SHED_PRIMITIVES_H +#define SHED_PRIMITIVES_H + +#include "./patio/patio.h" + +typedef PatioInt ShedObject; + +extern ShedObject const shed_unit; + +#endif diff --git a/runtime/src/shed.c b/runtime/src/shed.c index 478f51c2..05e5dd9b 100644 --- a/runtime/src/shed.c +++ b/runtime/src/shed.c @@ -6,8 +6,6 @@ #include "./shed.h" -ShedObject const shed_unit = 0; - #ifdef __WASM__ void* malloc(unsigned long); diff --git a/runtime/src/shed.h b/runtime/src/shed.h index 4f694e2d..7b135e3c 100644 --- a/runtime/src/shed.h +++ b/runtime/src/shed.h @@ -3,12 +3,10 @@ #include "./std.h" #include "./patio/patio.h" +#include "./primitives.h" -typedef PatioInt ShedObject; typedef PatioInt ShedStringLength; -extern ShedObject const shed_unit; - struct ShedString { ShedStringLength length; uint8_t data[]; -- cgit v1.2.3