aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-01-20 14:41:50 -0600
committerGanesh Viswanathan <dev@genotrance.com>2019-01-20 14:41:50 -0600
commit65111455134774bd965bc52b22556d9942e1888f (patch)
treead56596246bbb614b7d9fb291f8749c42a23e3cd
parentbe1fe6495cbd1649a03ce6ee5bcca18e49da9ae1 (diff)
downloadnimterop-65111455134774bd965bc52b22556d9942e1888f.tar.gz
nimterop-65111455134774bd965bc52b22556d9942e1888f.zip
Fix #36 - va_list and time_t
-rw-r--r--nimterop/cimport.nim3
-rw-r--r--nimterop/getters.nim6
-rw-r--r--nimterop/types.nim4
3 files changed, 8 insertions, 5 deletions
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:"<stdarg.h>".} = object \ No newline at end of file