Locks modules should give a compile error when threads are not enabled. (#12231)
* Locks modules should give a compile error when threads are not enabled. * fix the compile flags to make the tests pass, or ignore files where necessary. * Fixed when statement to account for doc builds.
This commit is contained in:
parent
944fcc0e62
commit
9dd297f613
4 changed files with 13 additions and 0 deletions
|
|
@ -9,6 +9,10 @@
|
||||||
|
|
||||||
## This module contains Nim's support for locks and condition vars.
|
## This module contains Nim's support for locks and condition vars.
|
||||||
|
|
||||||
|
|
||||||
|
when not compileOption("threads") and not defined(nimdoc):
|
||||||
|
{.error: "Locks requires --threads:on option.".}
|
||||||
|
|
||||||
const insideRLocksModule = false
|
const insideRLocksModule = false
|
||||||
include "system/syslocks"
|
include "system/syslocks"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@
|
||||||
|
|
||||||
## This module contains Nim's support for reentrant locks.
|
## This module contains Nim's support for reentrant locks.
|
||||||
|
|
||||||
|
|
||||||
|
when not compileOption("threads") and not defined(nimdoc):
|
||||||
|
{.error: "Rlocks requires --threads:on option.".}
|
||||||
|
|
||||||
const insideRLocksModule = true
|
const insideRLocksModule = true
|
||||||
include "system/syslocks"
|
include "system/syslocks"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -558,6 +558,10 @@ const disabledFilesDefault = @[
|
||||||
"setimpl.nim",
|
"setimpl.nim",
|
||||||
"hashcommon.nim",
|
"hashcommon.nim",
|
||||||
|
|
||||||
|
# Requires compiling with '--threads:on`
|
||||||
|
"sharedlist.nim",
|
||||||
|
"sharedtables.nim",
|
||||||
|
|
||||||
# Error: undeclared identifier: 'hasThreadSupport'
|
# Error: undeclared identifier: 'hasThreadSupport'
|
||||||
"ioselectors_epoll.nim",
|
"ioselectors_epoll.nim",
|
||||||
"ioselectors_kqueue.nim",
|
"ioselectors_kqueue.nim",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
discard """
|
discard """
|
||||||
|
cmd: "nim $target --threads:on $options $file"
|
||||||
output: '''
|
output: '''
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue