Ivan FB
b598255f74
fix Lib-name derivation breaks on names with underscores (rust.nim:54, cpp.nim:38–42). parts[0] of nim_timer_create is "nim", not "nim_timer". The example library happens to be
...
nimtimer, so this never bites. The currentLibName short-circuit covers the registered case, but the fallback path is wrong, and silent.
2026-05-11 22:39:41 +02:00
Ivan FB
1eb8f2bdf8
fix Hardcoded Nim build flags in generated build files. build.rs and CMakeLists.txt both bake in --mm:orc and -d:chronicles_log_level=WARN (rust.nim:121–122, cpp.nim:463–464).
...
The whole point of a generic generator is decoupling — this couples every consumer of nim-ffi to one specific project's Nim build conventions. Plumb these through
genBindings() parameters or a config block.
2026-05-11 22:11:25 +02:00
Ivan FB
8479fb8ad3
fix build.rs is broken on Windows (rust.nim:112–115). lib_ext is only set under cfg(target_os = "macos"|"linux"). On Windows the symbol is undefined → compile error. The
...
CMakeLists handles Windows; the Rust generator should either match or fail loudly.
2026-05-11 21:25:05 +02:00
Ivan FB
51ed83b04a
fix Async constructor cannot specify a timeout (rust.nim:416). new_async hardcodes Duration::from_secs(30) for all subsequent calls on the produced Ctx, while blocking create
...
accepts a timeout: Duration. Inconsistent and a footgun for any user who picks the async path. Add the parameter.
2026-05-11 21:23:24 +02:00
Ivan FB
24a56032af
Fix Rust callbacks dereference msg without a null check (rust.nim:272, 317). CStr::from_ptr(msg) is UB if msg == nullptr. The C++ side guards with msg ? ... : "". The Nim side
...
appears to always pass a non-null pointer, but soundness across an FFI boundary shouldn't hinge on a producer's discipline — the Rust receiver should null-check. Especially
since the C ABI signature here is the one downstream consumers will rely on indefinitely.
2026-05-11 09:40:33 +02:00
Ivan FB
2f6ef08e6c
fix rust leaks
2026-05-11 09:35:47 +02:00
Ivan FB
729801b999
Add ffiDtor concept
2026-05-10 11:38:43 +02:00
Ivan FB
798f5a21ed
simplify auto-generate cpp and rust
2026-05-10 11:38:42 +02:00
Ivan FB
d87fe8b104
enhance cpp and rust tokio examples
...
Co-authored-by: Copilot <copilot@github.com>
2026-05-10 11:38:41 +02:00
Ivan FB
5b908b9c5b
simplify ffi generation and add simple Rust example
2026-05-10 11:35:02 +02:00