diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-16 11:47:15 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-16 11:47:15 +0000 |
| commit | faa7e7649e25e6f25f56be3bec5cd5ffd741e511 (patch) | |
| tree | 8ed897fe90bd754ff65b0088a529ca443867be79 /runtime | |
| parent | 10a0cbfed64907030399ed69879ee495ae8b692c (diff) | |
Extract primitives{.h,.c}
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/meson.build | 1 | ||||
| -rw-r--r-- | runtime/src/patio/patio.h | 2 | ||||
| -rw-r--r-- | runtime/src/primitives.c | 3 | ||||
| -rw-r--r-- | runtime/src/primitives.h | 10 | ||||
| -rw-r--r-- | runtime/src/shed.c | 2 | ||||
| -rw-r--r-- | runtime/src/shed.h | 4 |
6 files changed, 17 insertions, 5 deletions
diff --git a/runtime/meson.build b/runtime/meson.build index 0dbb5277..1cdb2de9 100644 --- a/runtime/meson.build +++ b/runtime/meson.build @@ -4,6 +4,7 @@ static_library( 'src/effects.c', 'src/exceptions.c', 'src/ints.c', + 'src/primitives.c', 'src/shed.c', 'src/strings.c', 'src/namespaces/Shed/Builtins.c', 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[]; |
