introduce csize_t instead of fixing csize (#12497)

This commit is contained in:
Arne Döring
2019-10-31 19:18:12 +01:00
committed by Andreas Rumpf
parent 0c7b6c9c15
commit 99078d80d7
18 changed files with 101 additions and 97 deletions

View File

@@ -27,9 +27,9 @@ main()
#bug #6837
type StdString {.importCpp: "std::string", header: "<string>", byref.} = object
proc initString(): StdString {.constructor, importCpp: "std::string(@)", header: "<string>".}
proc size(this: var StdString): csize {.importCpp: "size", header: "<string>".}
proc size(this: var StdString): csize_t {.importCpp: "size", header: "<string>".}
proc f(): csize =
proc f(): csize_t =
var myString: StdString = initString()
return myString.size()

View File

@@ -36,9 +36,9 @@ proc bar(): VectorAlt[cstring] =
var x = foo()
var y = bar()
proc init[T; Self: Vector[T]](_: typedesc[Self], n: csize): Vector[T]
proc init[T; Self: Vector[T]](_: typedesc[Self], n: csize_t): Vector[T]
{.importcpp: "std::vector<'*0>(@)", header: "<vector>", constructor, nodecl.}
proc size[T](x: Vector[T]): csize
proc size[T](x: Vector[T]): csize_t
{.importcpp: "#.size()", header: "<vector>", nodecl.}
var z = Vector[int16].init(32)