Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type_map() #488

Merged
merged 1 commit into from
Sep 21, 2024
Merged

Fix type_map() #488

merged 1 commit into from
Sep 21, 2024

Conversation

kleisauke
Copy link
Member

We cannot declare VipsTypeMap2Fn as opaque as this callback is used by type_map(). Instead, restore the VipsTypeMap2Fn definition and use an opaque pointer for the second argument of vips_type_map().

Details
$ python3 gen_cpp_binding.py
Traceback (most recent call last):
  File "/home/kleisauke/wasm-vips/build/gen_cpp_binding.py", line 295, in <module>
    generate_enums_flags('enums.cpp')
  File "/home/kleisauke/wasm-vips/build/gen_cpp_binding.py", line 230, in generate_enums_flags
    type_map(type_from_name('GEnum'), add_enum)
  File "/home/kleisauke/.local/lib/python3.12/site-packages/pyvips/base.py", line 105, in type_map
    cb = ffi.callback('VipsTypeMap2Fn', fn)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected a function ctype, got 'VipsTypeMap2Fn'

Regressed since: #464.

We cannot declare `VipsTypeMap2Fn` as opaque as this callback is used
by `type_map()`. Instead, restore the `VipsTypeMap2Fn` definition and
use an opaque pointer for the second argument of `vips_type_map()`.
@jcupitt jcupitt merged commit 2c67877 into libvips:master Sep 21, 2024
6 checks passed
@kleisauke kleisauke deleted the fix-type-map branch September 21, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants