Move #assert to types file

This commit is contained in:
gingerBill
2025-06-20 10:48:30 +01:00
parent 62db888ac1
commit 293267c7b2
2 changed files with 5 additions and 7 deletions
+2 -6
View File
@@ -10,12 +10,8 @@ when ODIN_OS == .Windows {
}
}
import "core:c"
import "core:mem"
#assert(size_of(c.int) == size_of(b32))
#assert(size_of(u32) == size_of(b32))
@(default_calling_convention="c", link_prefix="kbts_", require_results)
foreign lib {
FontIsValid :: proc(Font: ^font) -> b32 ---
@@ -29,7 +25,7 @@ foreign lib {
Shape :: proc(State: ^shape_state, Config: ^shape_config,
MainDirection, RunDirection: direction,
Glyphs: [^]glyph, GlyphCount: ^u32, GlyphCapacity: u32) -> c.int ---
Glyphs: [^]glyph, GlyphCount: ^u32, GlyphCapacity: u32) -> b32 ---
Cursor :: proc(Direction: direction) -> cursor ---
BeginBreak :: proc(State: ^break_state, MainDirection: direction, JapaneseLineBreakStyle: japanese_line_break_style) ---
@@ -153,7 +149,7 @@ PositionGlyph :: proc(Cursor: ^cursor, Glyph: ^glyph) -> (X, Y: i32) {
@(require_results)
ShapeDynamic :: proc(State: ^shape_state, Config: ^shape_config,
MainDirection, RunDirection: direction,
Glyphs: ^[dynamic]glyph) -> c.int {
Glyphs: ^[dynamic]glyph) -> b32 {
GlyphCount := u32(len(Glyphs^))
GlyphCapacity := u32(cap(Glyphs^))
Res := Shape(State, Config, MainDirection, RunDirection, raw_data(Glyphs^), &GlyphCount, GlyphCapacity)
+3 -1
View File
@@ -2,7 +2,9 @@ package vendor_kb_text_shape
import "core:c"
#assert(size_of(b8) == size_of(bool))
#assert(size_of(b8) == size_of(bool))
#assert(size_of(b32) == size_of(u32))
#assert(size_of(b32) == size_of(c.int))
un :: distinct (
uint when (size_of(uintptr) == size_of(uint)) else