UFCS issue

2021-11-15 Thread mantielero
Wow thanks a lot. I think I would have never found it.

UFCS issue

2021-11-15 Thread shirleyquirk
If I've found the right code you've got type ConsumerS = object ... close: proc (a1: Consumer) {.cdecl.} Consumer = ptr ConsumerS Run which means `c.close()` refers to the member `close` of c, i.e. a proc which expects a parameter

UFCS issue

2021-11-15 Thread rb3
Might be that `impmltDyn` macro is causing the `a` parameter to `mlt_consumer_close` to disappear. Try doing import std/macros expandMacros: proc mlt_consumer_close*(a1: mlt_consumer) {.importc, cdecl, impmltDyn.} Run and see what it expands to.

UFCS issue

2021-11-14 Thread mantielero
I am having an issue with the calling convention. I have the following function: type Consumer* = mlt_consumer ... proc mlt_consumer_close*(a1: mlt_consumer) {.importc, cdecl, impmltDyn.} ... proc close*(a:Consumer) = mlt_consumer_close(a)