Add sideEffect pragma to importC procs in posix, winlean and time module (#13370)
* Add sideEffect pragma to procs in winlean * Add sideEffect pragma to procs in posix * Add test for #13306 * Add sideEffect pragma to procs in times * Fixes #13306
This commit is contained in:
parent
e4415422fe
commit
2a4aa24620
4 changed files with 144 additions and 132 deletions
|
|
@ -232,7 +232,7 @@ elif defined(posix):
|
|||
|
||||
when defined(macosx):
|
||||
proc gettimeofday(tp: var Timeval, unused: pointer = nil)
|
||||
{.importc: "gettimeofday", header: "<sys/time.h>".}
|
||||
{.importc: "gettimeofday", header: "<sys/time.h>", sideEffect.}
|
||||
|
||||
elif defined(windows):
|
||||
import winlean, std/time_t
|
||||
|
|
@ -254,7 +254,7 @@ elif defined(windows):
|
|||
tm_yday*: cint ## Day of year [0,365].
|
||||
tm_isdst*: cint ## Daylight Savings flag.
|
||||
|
||||
proc localtime(a1: var CTime): ptr Tm {.importc, header: "<time.h>".}
|
||||
proc localtime(a1: var CTime): ptr Tm {.importc, header: "<time.h>", sideEffect.}
|
||||
|
||||
type
|
||||
Month* = enum ## Represents a month. Note that the enum starts at ``1``,
|
||||
|
|
@ -2527,7 +2527,7 @@ when not defined(js):
|
|||
Clock {.importc: "clock_t".} = distinct int
|
||||
|
||||
proc getClock(): Clock
|
||||
{.importc: "clock", header: "<time.h>", tags: [TimeEffect], used.}
|
||||
{.importc: "clock", header: "<time.h>", tags: [TimeEffect], used, sideEffect.}
|
||||
|
||||
var
|
||||
clocksPerSec {.importc: "CLOCKS_PER_SEC", nodecl, used.}: int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue