Skip to content

Commit 21c14c1

Browse files
committed
Update FFI expected files for improved pointer type resolution
The LLVM 22 FFI fixes now resolve struct pointer fields to typed pointers (e.g., B.ptr) instead of generic :pointer on all LLVM versions.
1 parent 8bfa52b commit 21c14c1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/bindings/c/forward.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
module Forward
44

55
class F < FFI::Struct
6-
layout :b, :pointer,
7-
:c, :pointer
6+
layout :b, B.ptr,
7+
:c, C.ptr
88
end
99

1010
class B < FFI::Struct

test/bindings/c/sqlite3.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Sqlite3
2020
attach_function :sqlite3_exec, :sqlite3_exec, [:pointer, :string, :sqlite3_exec_callback_callback, :pointer, :pointer], :int
2121

2222
class Sqlite3File < FFI::Struct
23-
layout :p_methods, :pointer
23+
layout :p_methods, Sqlite3IoMethods.ptr
2424
end
2525

2626
callback :sqlite3_io_methods_x_close_callback, [:pointer], :int
@@ -89,7 +89,7 @@ class Sqlite3Vfs < FFI::Struct
8989
layout :i_version, :int,
9090
:sz_os_file, :int,
9191
:mx_pathname, :int,
92-
:p_next, :pointer,
92+
:p_next, Sqlite3Vfs.ptr,
9393
:z_name, :string,
9494
:p_app_data, :pointer,
9595
:x_open, :sqlite3_vfs_x_open_callback,
@@ -478,13 +478,13 @@ class Sqlite3IndexInfo < FFI::Struct
478478
attach_function :sqlite3_drop_modules, :sqlite3_drop_modules, [:pointer, :pointer], :int
479479

480480
class Sqlite3Vtab < FFI::Struct
481-
layout :p_module, :pointer,
481+
layout :p_module, Sqlite3Module.ptr,
482482
:n_ref, :int,
483483
:z_err_msg, :pointer
484484
end
485485

486486
class Sqlite3VtabCursor < FFI::Struct
487-
layout :p_vtab, :pointer
487+
layout :p_vtab, Sqlite3Vtab.ptr
488488
end
489489

490490
attach_function :sqlite3_declare_vtab, :sqlite3_declare_vtab, [:pointer, :string], :int

0 commit comments

Comments
 (0)