From 65111455134774bd965bc52b22556d9942e1888f Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Sun, 20 Jan 2019 14:41:50 -0600 Subject: Fix #36 - va_list and time_t --- nimterop/cimport.nim | 3 +++ nimterop/getters.nim | 6 +----- nimterop/types.nim | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 nimterop/types.nim diff --git a/nimterop/cimport.nim b/nimterop/cimport.nim index c5955c6..bb2217c 100644 --- a/nimterop/cimport.nim +++ b/nimterop/cimport.nim @@ -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()) diff --git a/nimterop/getters.nim b/nimterop/getters.nim index 06688a9..cc5b0a2 100644 --- a/nimterop/getters.nim +++ b/nimterop/getters.nim @@ -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 = diff --git a/nimterop/types.nim b/nimterop/types.nim new file mode 100644 index 0000000..80ba603 --- /dev/null +++ b/nimterop/types.nim @@ -0,0 +1,4 @@ +type + time_t* = int32 + ptrdiff_t* = ByteAddress + va_list* {.importc: "va_list", header:"".} = object \ No newline at end of file -- cgit v1.2.3