diff options
| author | 2022-08-19 16:31:16 +0200 | |
|---|---|---|
| committer | 2022-08-19 16:31:16 +0200 | |
| commit | 57af02b91cb3a9eef66137c85aab7e47bdd7d0a5 (patch) | |
| tree | c0597811c61d473263559ab7ffefe68ab8785c47 /src/type.cff | |
| parent | 9e408967cbdfa1d04e4bd4bc963399e7be78c0a7 (diff) | |
labels, #FILE #LINE, some bugfixes, c types
Diffstat (limited to 'src/type.cff')
| -rw-r--r-- | src/type.cff | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/type.cff b/src/type.cff index 713716b..b0cb259 100644 --- a/src/type.cff +++ b/src/type.cff @@ -135,26 +135,32 @@ extern fn completetype(ty *const Type) bool { return #t; } -extern static ty_void *const Type = {}, - ty_bool *const Type = {}, - ty_intbool *const Type = {}, - ty_i8 *const Type = {}, - ty_u8 *const Type = {}, - ty_i16 *const Type = {}, - ty_u16 *const Type = {}, - ty_i32 *const Type = {}, - ty_u32 *const Type = {}, - ty_int *const Type = {}, - ty_uint *const Type = {}, - ty_i64 *const Type = {}, - ty_u64 *const Type = {}, - ty_isize *const Type = {}, - ty_usize *const Type = {}, - ty_iptrint *const Type = {}, - ty_uptrint *const Type = {}, - ty_f32 *const Type = {}, - ty_f64 *const Type = {}, - ty_voidptr *const Type = {}; +extern static ty_void *const Type = {}, + ty_bool *const Type = {}, + ty_intbool *const Type = {}, + ty_i8 *const Type = {}, + ty_u8 *const Type = {}, + ty_i16 *const Type = {}, + ty_u16 *const Type = {}, + ty_i32 *const Type = {}, + ty_u32 *const Type = {}, + ty_int *const Type = {}, + ty_uint *const Type = {}, + ty_i64 *const Type = {}, + ty_u64 *const Type = {}, + ty_isize *const Type = {}, + ty_usize *const Type = {}, + ty_iptrint *const Type = {}, + ty_uptrint *const Type = {}, + ty_f32 *const Type = {}, + ty_f64 *const Type = {}, + ty_voidptr *const Type = {}, + ty_c_char *const Type = {}, + ty_c_long *const Type = {}, + ty_c_ulong *const Type = {}, + ty_c_llong *const Type = {}, + ty_c_ullong *const Type = {}, + ty_c_valist *const Type = {}; extern fn putprimtypes(env *Env) void { let types []struct { name *const u8, gty **const Type, ty Type } = { @@ -177,6 +183,12 @@ extern fn putprimtypes(env *Env) void { { "u64", &ty_u64, { .size: 8, g_targ.i64align, .u: :Int { .sgn: #f }}}, { "iptrint",&ty_iptrint, { g_targ.ptrsize, .u: :Int { .sgn: #t }}}, { "uptrint",&ty_uptrint, { g_targ.ptrsize, .u: :Int { .sgn: #f }}}, + { "c_char", &ty_c_char, { .size: 1, .u: :Int { .sgn: g_targ.charsigned }}}, + { "c_long", &ty_c_long, { g_targ.longsize, g_targ.longalign, .u: :Int { .sgn : #t }}}, + { "c_ulong",&ty_c_ulong, { g_targ.longsize, g_targ.longalign, .u: :Int { .sgn : #f }}}, + { "c_llong",&ty_c_llong, { g_targ.llongsize, g_targ.llongalign, .u: :Int { .sgn : #t }}}, + { "c_ullong",&ty_c_ullong,{ g_targ.llongsize, g_targ.llongalign, .u: :Int { .sgn : #f }}}, + { "c_valist",&ty_c_valist,{ g_targ.valistsize, g_targ.valistalign, .u: :VaList }}, }; foreach(type, _, types[0::]) { |