Marshal now works with nil strings. Timezone and tzname vars are not public any more in the times module.

This commit is contained in:
Dominik Picheta 2012-05-30 22:35:43 +01:00
commit 2509c08d34
2 changed files with 4 additions and 3 deletions

View file

@ -479,6 +479,7 @@ proc setBiggestFloat*(x: TAny, y: biggestFloat) =
proc getString*(x: TAny): string = proc getString*(x: TAny): string =
## retrieve the string value out of `x`. `x` needs to represent a string. ## retrieve the string value out of `x`. `x` needs to represent a string.
assert x.rawtype.kind == tyString assert x.rawtype.kind == tyString
if not isNil(cast[ptr pointer](x.value)[]):
result = cast[ptr string](x.value)[] result = cast[ptr string](x.value)[]
proc setString*(x: TAny, y: string) = proc setString*(x: TAny, y: string) =

View file

@ -26,8 +26,8 @@ type
dMon, dTue, dWed, dThu, dFri, dSat, dSun dMon, dTue, dWed, dThu, dFri, dSat, dSun
var var
timezone* {.importc, header: "<time.h>".}: int timezone {.importc, header: "<time.h>".}: int
tzname* {.importc, header: "<time.h>" .}: array[0..1, cstring] tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
when defined(posix): when defined(posix):
type type