> When I manually edited the C output to fix this, everything worked as > expected.
Great. You should try to contact Araq or file a bug report to Nim issue tracker. I can remember complains about such bugs long time ago -- I assumed they were fixed already. One temporary solution may be use of the byCopy pragma -- I think that is applied to the object itself, not to the procs. I will do a google or forum search to give you an example, stay tuned: OK, this seems to be a related bug report [https://github.com/nim-lang/c2nim/issues/84](https://github.com/nim-lang/c2nim/issues/84) And here is a wrapper where the byCopy pragma is applied to objects: [https://github.com/fowlmouth/nanovg.nim/blob/master/nvg.nim](https://github.com/fowlmouth/nanovg.nim/blob/master/nvg.nim)
