From 343024738a57dc0c201d54068b79e24e873f00c7 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sun, 27 Jan 2019 16:21:45 -0800 Subject: fix #71; bug fixes in types.nim --- nimterop/types.nim | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/nimterop/types.nim b/nimterop/types.nim index 80ba603..d9ffdcd 100644 --- a/nimterop/types.nim +++ b/nimterop/types.nim @@ -1,4 +1,33 @@ +#[ +TODO: +this should pull as few dependencies as needed by the wrapper, one option is, for the types that carry a dependency, wrap the type declaration inside something like: +``` +when defined(nimteropNeeds_va_list): + type + va_list* {.importc, header:"".} = object +``` + +TODO: +nimterop should replace the generated wrappers with the nim-idiomatic version, eg: +``` +proc mylib(a: ptrdiff_t) => proc mylib(a: ByteAddress) +``` +]# + +from std/time_t import nil # for time_t + +export time_t + type - time_t* = int32 ptrdiff_t* = ByteAddress - va_list* {.importc: "va_list", header:"".} = object \ No newline at end of file + +type + va_list* {.importc, header:"".} = object + +when defined(c): + # http://www.cplusplus.com/reference/cwchar/wchar_t/ In C++, wchar_t is a distinct fundamental type (and thus it is not defined in nor any other header). + type + wchar_t* {.importc, header:"".} = object +elif defined(cpp): + type + wchar_t* {.importc.} = object -- cgit v1.2.3