aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-10-18 11:19:19 -0500
committerGanesh Viswanathan <dev@genotrance.com>2019-10-18 11:19:19 -0500
commitd3b558b291be1d6dd0885de2ef154b70ed2cfbac (patch)
tree1e9802e216b946af10c8f8744d503c6020eb86a0
parente9120eee7840851bda8113afbc71062b29fff872 (diff)
downloadnimterop-d3b558b291be1d6dd0885de2ef154b70ed2cfbac.tar.gz
nimterop-d3b558b291be1d6dd0885de2ef154b70ed2cfbac.zip
Fix wchar_t for nim check
-rw-r--r--nimterop/types.nim19
1 files changed, 9 insertions, 10 deletions
diff --git a/nimterop/types.nim b/nimterop/types.nim
index 3dd8f39..a57252f 100644
--- a/nimterop/types.nim
+++ b/nimterop/types.nim
@@ -16,22 +16,21 @@ when (NimMajor, NimMinor, NimPatch) < (0, 19, 9):
type
time_t* = Time
time64_t* = Time
- wchar_t* {.importc.} = object
else:
import std/time_t as time_t_temp
type
time_t* = time_t_temp.Time
time64_t* = time_t_temp.Time
- when defined(c) or defined(nimdoc):
- # 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
+when defined(cpp):
+ # 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.} = object
+else:
+ type
+ wchar_t* {.importc, header:"<cwchar>".} = object
type
ptrdiff_t* = ByteAddress