c bool support and c-integer coercion

This commit is contained in:
2026-06-25 17:53:04 +02:00
parent c08bc6d0cc
commit e0b6f6049c
10 changed files with 80 additions and 13 deletions
+1
View File
@@ -9,6 +9,7 @@ INVALID_TYPE :: Type_Id(0xffff_ffff)
Type_Kind :: enum u8 {
Invalid,
Void,
C_Bool,
C_Char,
C_Schar,
C_Uchar,
+2
View File
@@ -132,6 +132,7 @@ CXTLS_None :: i32(0)
CXType_Invalid :: i32(0)
CXType_Unexposed :: i32(1)
CXType_Void :: i32(2)
CXType_Bool :: i32(3)
CXType_Char_U :: i32(4)
CXType_UChar :: i32(5)
CXType_UShort :: i32(8)
@@ -435,6 +436,7 @@ translate_type :: proc(ctx: ^Context, value: CXType, preferred_record_name := ""
}
switch value.kind {
case CXType_Void: return add_type(ctx, Type{kind=.Void, child=INVALID_TYPE})
case CXType_Bool: return add_type(ctx, Type{kind=.C_Bool, child=INVALID_TYPE})
case CXType_Char_U: return add_type(ctx, Type{kind=.C_Char, child=INVALID_TYPE})
case CXType_Char_S: return add_type(ctx, Type{kind=.C_Char, child=INVALID_TYPE})
case CXType_SChar: return add_type(ctx, Type{kind=.C_Schar, child=INVALID_TYPE})