new VM: some progress for the FFI support

This commit is contained in:
Araq 2013-12-23 01:17:48 +01:00
commit 9145bcfbb6
8 changed files with 80 additions and 60 deletions

View file

@ -101,7 +101,8 @@ proc newWideCString*(s: cstring): WideCString =
if s.isNil: return nil
when not defined(c_strlen):
proc c_strlen(a: CString): int {.nodecl, noSideEffect, importc: "strlen".}
proc c_strlen(a: cstring): int {.
header: "<string.h>", noSideEffect, importc: "strlen".}
let L = cstrlen(s)
result = newWideCString(s, L)