alef 0.25.37

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
{{ indent }}if (NativeMethods.LastErrorCode() != 0)
{{ indent }}{
{{ indent }}    var ec = NativeMethods.LastErrorCode();
{{ indent }}    var ctxPtr = NativeMethods.LastErrorContext();
{{ indent }}    var msg = global::System.Runtime.InteropServices.Marshal.PtrToStringUTF8(ctxPtr) ?? "{{ operation }} failed";
{{ indent }}    throw new {{ exception_name }}(ec, msg);
{{ indent }}}