Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
@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