diff options
| -rw-r--r-- | nimterop/types.nim | 33 |
1 files 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:"<stdarg.h>".} = 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:"<stdarg.h>".} = object
\ No newline at end of file + +type + va_list* {.importc, header:"<stdarg.h>".} = 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 <cwchar> nor any other header). + type + wchar_t* {.importc, header:"<cwchar>".} = object +elif defined(cpp): + type + wchar_t* {.importc.} = object |
