Deprecate timeToTimeInfo, add str->time procs
* depreciate timeToTimeInfo, add str->time procs
initTime allows creating times from strings. initTimeFromStr offers a default format string compatible with $Time.
timeToTimeInterval changed to work properly.
* Spell {.deprecated.} correctly
* deprecated timeToTimeInfo, removed initTime procs
Is it even worth depreciating timeToTimeInfo rather than just removing it, considering it's just wrong and we have getLocalTime and getGMTime that actually work? Also, if I'm renaming timeToTimeInfo -> toTimeInfo etc, isn't the deprecated tag kind of redundant?
* Updated names for toTime and toTimeInterval procs
* Added type to toTime template
This should allow compilation of os.nim now that toTime is defined in times.nim.
* Updated toTime template to use {.gensym.}
Local templates default to 'bind' semantics, not 'gensym'. This was causing a failure to 'see' the local toTime template.
This commit is contained in:
parent
d1ba2d42bf
commit
d9ed61fa62
2 changed files with 45 additions and 38 deletions
|
|
@ -1452,7 +1452,7 @@ template rawToFormalFileInfo(rawInfo, formalInfo): expr =
|
|||
## 'rawInfo' is either a 'TBY_HANDLE_FILE_INFORMATION' structure on Windows,
|
||||
## or a 'Stat' structure on posix
|
||||
when defined(Windows):
|
||||
template toTime(e): expr = winTimeToUnixTime(rdFileTime(e))
|
||||
template toTime(e: FILETIME): expr {.gensym.} = winTimeToUnixTime(rdFileTime(e)) # local templates default to bind semantics
|
||||
template merge(a, b): expr = a or (b shl 32)
|
||||
formalInfo.id.device = rawInfo.dwVolumeSerialNumber
|
||||
formalInfo.id.file = merge(rawInfo.nFileIndexLow, rawInfo.nFileIndexHigh)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue