From c41b1eb03ec1ebe56fd5cf21e7f7604c699c3693 Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Thu, 6 Oct 2022 05:10:49 +0200 Subject: [PATCH] fix: set calling convention for callback function prototypes Signed-off-by: Christopher Arndt --- examples/test_port_connect_cb.nim | 2 +- jacket.nim | 34 +++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/test_port_connect_cb.nim b/examples/test_port_connect_cb.nim index 99032eb..5b58973 100644 --- a/examples/test_port_connect_cb.nim +++ b/examples/test_port_connect_cb.nim @@ -15,7 +15,7 @@ proc cleanup() {.noconv.} = quit 0 -proc portConnected(portA: PortIdT; portB: PortIdT; connect: cint; arg: pointer) {.exportc.} = +proc portConnected(portA: PortIdT; portB: PortIdT; connect: cint; arg: pointer) {.cdecl.} = let portAPtr = portById(client, portA) let portBPtr = portById(client, portB) diff --git a/jacket.nim b/jacket.nim index 45c74e1..66d0f32 100644 --- a/jacket.nim +++ b/jacket.nim @@ -86,23 +86,23 @@ type # Callback function types type - JackProcessCallback* = proc (nframes: NframesT; arg: pointer): cint - JackThreadCallback* = proc (arg: pointer): pointer - JackThreadInitCallback* = proc (arg: pointer) - JackGraphOrderCallback* = proc (arg: pointer): cint - JackXRunCallback* = proc (arg: pointer): cint - JackBufferSizeCallback* = proc (nframes: NframesT; arg: pointer): cint - JackSampleRateCallback* = proc (nframes: NframesT; arg: pointer): cint - JackPortRegistrationCallback* = proc (port: PortIdT; flag: cint; arg: pointer) - JackClientRegistrationCallback* = proc (name: cstring; flag: cint; arg: pointer) - JackPortConnectCallback* = proc (portA: PortIdT; portB: PortIdT; connect: cint; arg: pointer) - JackPortRenameCallback* = proc (port: PortIdT; oldName: cstring; newName: cstring; arg: pointer) - JackFreewheelCallback* = proc (starting: cint; arg: pointer) - JackShutdownCallback* = proc (arg: pointer) - JackInfoShutdownCallback* = proc (code: JackStatus; reason: cstring; arg: pointer) - JackLatencyCallback* = proc (mode: JackLatencyCallbackMode; arg: pointer) - JackInfoCallback* = proc (msg: cstring) - JackErrorCallback* = proc (msg: cstring) + JackProcessCallback* = proc (nframes: NframesT; arg: pointer): cint {.cdecl.} + JackThreadCallback* = proc (arg: pointer): pointer {.cdecl.} + JackThreadInitCallback* = proc (arg: pointer) {.cdecl.} + JackGraphOrderCallback* = proc (arg: pointer): cint {.cdecl.} + JackXRunCallback* = proc (arg: pointer): cint {.cdecl.} + JackBufferSizeCallback* = proc (nframes: NframesT; arg: pointer): cint {.cdecl.} + JackSampleRateCallback* = proc (nframes: NframesT; arg: pointer): cint {.cdecl.} + JackPortRegistrationCallback* = proc (port: PortIdT; flag: cint; arg: pointer) {.cdecl.} + JackClientRegistrationCallback* = proc (name: cstring; flag: cint; arg: pointer) {.cdecl.} + JackPortConnectCallback* = proc (portA: PortIdT; portB: PortIdT; connect: cint; arg: pointer) {.cdecl.} + JackPortRenameCallback* = proc (port: PortIdT; oldName: cstring; newName: cstring; arg: pointer) {.cdecl.} + JackFreewheelCallback* = proc (starting: cint; arg: pointer) {.cdecl.} + JackShutdownCallback* = proc (arg: pointer) {.cdecl.} + JackInfoShutdownCallback* = proc (code: JackStatus; reason: cstring; arg: pointer) {.cdecl.} + JackLatencyCallback* = proc (mode: JackLatencyCallbackMode; arg: pointer) {.cdecl.} + JackInfoCallback* = proc (msg: cstring) {.cdecl.} + JackErrorCallback* = proc (msg: cstring) {.cdecl.} # ----------------------------- Version info ------------------------------