fix for 0.19.2
This commit is contained in:
parent
343024738a
commit
ecb2d54508
1 changed files with 23 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#[
|
||||
TODO:
|
||||
note:
|
||||
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):
|
||||
|
|
@ -7,16 +7,34 @@ when defined(nimteropNeeds_va_list):
|
|||
va_list* {.importc, header:"<stdarg.h>".} = object
|
||||
```
|
||||
|
||||
TODO:
|
||||
note:
|
||||
nimterop should replace the generated wrappers with the nim-idiomatic version, eg:
|
||||
```
|
||||
proc mylib(a: ptrdiff_t) => proc mylib(a: ByteAddress)
|
||||
```
|
||||
|
||||
note:
|
||||
as needed, provide (platform specific) nim aliases which can be used eg to compute sizeof, eg:
|
||||
type foo_t* {.importc, header: "<foo.h>".} = distinct int32
|
||||
]#
|
||||
|
||||
from std/time_t import nil # for time_t
|
||||
|
||||
export time_t
|
||||
when (NimMajor, NimMinor, NimPatch) < (0, 19, 9):
|
||||
# clean this up once upgraded; adapted from std/time_t
|
||||
when defined(nimdoc):
|
||||
type
|
||||
impl = distinct int64
|
||||
Time = impl
|
||||
elif defined(windows):
|
||||
when defined(i386) and defined(gcc):
|
||||
type Time {.importc: "time_t", header: "<time.h>".} = distinct int32
|
||||
else:
|
||||
type Time {.importc: "time_t", header: "<time.h>".} = distinct int64
|
||||
elif defined(posix):
|
||||
import posix
|
||||
type time_t* = Time
|
||||
else:
|
||||
import std/time_t as time_t_temp
|
||||
type time_t* = time_t_temp.Time
|
||||
|
||||
type
|
||||
ptrdiff_t* = ByteAddress
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue