Skip to content

Commit

Permalink
fix: Cython compile error with Cython 3
Browse files Browse the repository at this point in the history
Declare MIDI change callback as 'noexcept' as it needs the GIL

Signed-off-by: Christopher Arndt <[email protected]>
  • Loading branch information
SpotlightKid committed Nov 9, 2023
1 parent 2a65a70 commit 5f99220
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ information.
To build and install jack_mixer run:

```console
meson builddir --prefix=/usr --buildtype=release
meson setup builddir --prefix=/usr --buildtype=release
meson compile -C builddir
[sudo] meson install -C builddir
```
Expand Down
2 changes: 1 addition & 1 deletion src/_jack_mixer.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cdef extern from "jack_mixer.h":
ctypedef void * jack_mixer_output_channel_t
ctypedef void * jack_mixer_threshold_t

ctypedef void (*midi_change_callback)(void *)
ctypedef void (*midi_change_callback)(void *) noexcept with gil

cdef enum midi_behavior_mode:
pass
Expand Down
2 changes: 1 addition & 1 deletion src/_jack_mixer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import enum
from _jack_mixer cimport *


cdef void midi_change_callback_func(void *userdata) with gil:
cdef void midi_change_callback_func(void *userdata) noexcept with gil:
"""Wrapper for a Python callback function for MIDI input."""
channel = <object> userdata
channel._midi_change_callback()
Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if get_option('gui').enabled()
jack_mixer_mod_pyx = '_jack_mixer.pyx'
jack_mixer_mod_c = '_jack_mixer.c'

cython = find_program('cython3', 'cython', required: false)
cython = find_program('cython3', 'cython', 'cython0', required: false)

if fs.exists(jack_mixer_mod_c)
jack_mixer_cython = files(jack_mixer_mod_c)
Expand Down

0 comments on commit 5f99220

Please sign in to comment.