mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
Marshal now works with nil strings. Timezone and tzname vars are not public any more in the times module.
This commit is contained in:
@@ -479,7 +479,8 @@ proc setBiggestFloat*(x: TAny, y: biggestFloat) =
|
||||
proc getString*(x: TAny): string =
|
||||
## retrieve the string value out of `x`. `x` needs to represent a string.
|
||||
assert x.rawtype.kind == tyString
|
||||
result = cast[ptr string](x.value)[]
|
||||
if not isNil(cast[ptr pointer](x.value)[]):
|
||||
result = cast[ptr string](x.value)[]
|
||||
|
||||
proc setString*(x: TAny, y: string) =
|
||||
## sets the string value of `x`. `x` needs to represent a string.
|
||||
|
||||
@@ -26,8 +26,8 @@ type
|
||||
dMon, dTue, dWed, dThu, dFri, dSat, dSun
|
||||
|
||||
var
|
||||
timezone* {.importc, header: "<time.h>".}: int
|
||||
tzname* {.importc, header: "<time.h>" .}: array[0..1, cstring]
|
||||
timezone {.importc, header: "<time.h>".}: int
|
||||
tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
|
||||
|
||||
when defined(posix):
|
||||
type
|
||||
|
||||
Reference in New Issue
Block a user