addQuitProc now works with closures, and c, js(node/browser) backend; fix some bugs in testament (#14342)
* make addQuitProc great again * fix bugs in testament * fix test * change 2016 => 2020 * addQuitProc => addExitProc + locks * move to std/exitprocs
This commit is contained in:
parent
45cac4afda
commit
dfe51d10a1
9 changed files with 117 additions and 44 deletions
21
tests/stdlib/texitprocs.nim
Normal file
21
tests/stdlib/texitprocs.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
discard """
|
||||
targets: "c cpp js"
|
||||
output: '''
|
||||
ok4
|
||||
ok3
|
||||
ok2
|
||||
ok1
|
||||
'''
|
||||
"""
|
||||
|
||||
import std/exitprocs
|
||||
|
||||
proc fun1() {.noconv.} = echo "ok1"
|
||||
proc fun2() = echo "ok2"
|
||||
proc fun3() {.noconv.} = echo "ok3"
|
||||
proc fun4() = echo "ok4"
|
||||
|
||||
addExitProc(fun1)
|
||||
addExitProc(fun2)
|
||||
addExitProc(fun3)
|
||||
addExitProc(fun4)
|
||||
Loading…
Add table
Add a link
Reference in a new issue