Fix #36 - va_list and time_t

This commit is contained in:
Ganesh Viswanathan 2019-01-20 14:41:50 -06:00
commit 6511145513
3 changed files with 8 additions and 5 deletions

View file

@ -4,6 +4,9 @@ const CIMPORT {.used.} = 1
include "."/globals
import "."/types
export types
proc interpPath(dir: string): string=
# TODO: more robust: needs a DirSep after "$projpath"
result = dir.replace("$projpath", getProjectPath())

View file

@ -70,11 +70,7 @@ const gTypeMap = {
# floating point
"float": "cfloat",
"double": "cdouble",
"long double": "clongdouble",
# misc
"time_t": "int32",
"ptrdiff_t": "ByteAddress"
"long double": "clongdouble"
}.toTable()
proc sanitizePath*(path: string): string =

4
nimterop/types.nim Normal file
View file

@ -0,0 +1,4 @@
type
time_t* = int32
ptrdiff_t* = ByteAddress
va_list* {.importc: "va_list", header:"<stdarg.h>".} = object