buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.15k stars 31 forks source link

FFI Type Mismatch #230

Closed Its-Kenta closed 8 months ago

Its-Kenta commented 8 months ago

Encountering a type mismatch error when using the FFI to interact with Raylib. Raylib's Vector2 struct is defined as having 'float' fields for 'width' and 'height', but the FFI implementation seems to expect 'double' fields.

const Vector2 = extern struct {
    width: f32,
    height: f32,
};

func zdef_struct_Vector2_width_getter: in instruction 'dmov': unexpected operand mode for operand #2. Got 'float', expected 'double'

Changing the field types to 'f64' resolves the error, but it is inconsistent with Raylib's definition.