From: Brendan Hansen Date: Mon, 19 Apr 2021 17:14:19 +0000 (-0500) Subject: added Register typedef X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=6448f9fbb86b27a0edd831fb8dfa8ffbc3585536;p=onyx.git added Register typedef --- diff --git a/bin/onyx b/bin/onyx index a4b2ea14..de8d3eac 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/src/onyxc_output.c b/src/onyxc_output.c index d98f0b7d..945a77d5 100644 --- a/src/onyxc_output.c +++ b/src/onyxc_output.c @@ -16,9 +16,23 @@ static char* BOILERPLATE_TOP = "typedef double f64;\n" "typedef void *rawptr;\n"; - +static char* REGISTER_DEFINITION = + "typedef union Register {\n" + " u8 u8;\n" + " i8 i8;\n" + " i16 i16;\n" + " u16 u16;\n" + " i32 i32;\n" + " u32 u32;\n" + " i64 i64;\n" + " u64 u64;\n" + " f32 f32;\n" + " f64 f64;\n" + " rawptr rawptr;\n" + "} Register;"; void onyx_output_c_file(OnyxCFile* cfile, bh_file file) { bh_file_write(&file, BOILERPLATE_TOP, strlen(BOILERPLATE_TOP)); + bh_file_write(&file, REGISTER_DEFINITION, strlen(REGISTER_DEFINITION)); }