Header path compatibility for windows and added ttmath scope to uint

This commit is contained in:
coffeepots 2018-02-16 14:23:00 +00:00
parent ed24c5e5eb
commit c6e6d47895
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,7 @@
const TTMATH_HEADER = "headers/ttmathuint.h"
from os import DirSep
from strutils import rsplit
const ttmathPath = currentSourcePath.rsplit(DirSep, 1)[0]
const TTMATH_HEADER = ttmathPath & DirSep & "headers" & DirSep & "ttmath.h"
type
UInt256* {.importc: "ttmath::UInt<4>", header: TTMATH_HEADER.} = object
@ -36,7 +39,7 @@ proc `or`*(a: UInt256, b: UInt256): UInt256 {.importcpp: "(# | #)".}
proc `xor`*(a: UInt256, b: UInt256): UInt256 {.importcpp: "(# ^ #)".}
proc u256*(a: uint64): UInt256 {.importcpp: "ttmath::UInt<4>((uint)#)".}
proc u256*(a: uint64): UInt256 {.importcpp: "ttmath::UInt<4>((ttmath::uint)#)".}
proc u256*(a: cstring): UInt256 {.importcpp: "ttmath::UInt<4>(#)".}