diff options
| author | Timothee Cour <timothee.cour2@gmail.com> | 2019-01-27 16:21:45 -0800 |
|---|---|---|
| committer | genotrance <dev@genotrance.com> | 2019-01-28 16:47:13 -0600 |
| commit | 343024738a57dc0c201d54068b79e24e873f00c7 (patch) | |
| tree | c5c12db831219c1287c3280b22b316256f40ec50 | |
| parent | 31ec7987dbb7df21fa36e7aeb5fb2f4a93cb1cb3 (diff) | |
| download | nimterop-343024738a57dc0c201d54068b79e24e873f00c7.tar.gz nimterop-343024738a57dc0c201d54068b79e24e873f00c7.zip | |
fix #71; bug fixes in types.nim
| -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 |
