You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PS D:\code\ruby\sdl_test> ruby .\struct_test.rb
C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:261:in `parse_ctype': unknown type: bool (Fiddle::DLError)
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:71:in `block in parse_struct_signature'
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:43:in `each'
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/cparser.rb:43:in `parse_struct_signature'
from C:/Users/Dee/scoop/apps/ruby/3.3.6-2/lib/ruby/3.3.0/fiddle/import.rb:223:in `struct'
from ./struct_test.rb:6:in `<module:Test>'
from ./struct_test.rb:3:in `<main>'
Looks like parse_struct_signature passes the whole bool boolean_member string to parse_ctype, where it fails to be parsed because case expression tries to match on "bool" (i.e. a plain string) instead of a regex, something like /\Abool(?:\s+\w+)?\z/:
Activity
kou commentedon Jan 4, 2025
Could you open a PR with a test?
add regex for bool parsing & test struct w/ bool parsing (ruby#169)
[ruby/fiddle] add regex for bool parsing & test struct w/ bool
[ruby/fiddle] add regex for bool parsing & test struct w/ bool
[ruby/fiddle] add regex for bool parsing & test struct w/ bool