mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
(cherry picked from commit 89be5be03e)
This commit is contained in:
@@ -45,9 +45,9 @@ proc nimCmpMem*(a, b: pointer, size: Natural): cint {.compilerproc, nonReloadabl
|
||||
if d != 0: return d
|
||||
inc i
|
||||
|
||||
proc nimCStrLen*(a: cstring): csize_t {.compilerproc, nonReloadable, inline.} =
|
||||
proc nimCStrLen*(a: cstring): int {.compilerproc, nonReloadable, inline.} =
|
||||
when useLibC:
|
||||
c_strlen(a)
|
||||
cast[int](c_strlen(a))
|
||||
else:
|
||||
var a = cast[ptr byte](a)
|
||||
while a[] != 0:
|
||||
|
||||
@@ -41,3 +41,8 @@ except OverflowError, RangeError:
|
||||
echo x
|
||||
|
||||
echo expected == 4
|
||||
|
||||
# bug #13698
|
||||
var
|
||||
x45 = "hello".cstring
|
||||
p = x45.len.int32
|
||||
|
||||
Reference in New Issue
Block a user