system.nim cleanup some exported constants which should never have be… (#17909)
* system.nim cleanup some exported constants which should never have been exported
This commit is contained in:
parent
a55c7e9679
commit
fb86271556
10 changed files with 32 additions and 29 deletions
20
lib/system/coro_detection.nim
Normal file
20
lib/system/coro_detection.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
## Coroutine detection logic
|
||||
|
||||
template coroutinesSupportedPlatform(): bool =
|
||||
when defined(sparc) or defined(ELATE) or defined(boehmgc) or defined(gogc) or
|
||||
defined(nogc) or defined(gcRegions) or defined(gcMarkAndSweep):
|
||||
false
|
||||
else:
|
||||
true
|
||||
|
||||
when defined(nimCoroutines):
|
||||
# Explicit opt-in.
|
||||
when not coroutinesSupportedPlatform():
|
||||
{.error: "Coroutines are not supported on this architecture and/or garbage collector.".}
|
||||
const nimCoroutines* = true
|
||||
elif defined(noNimCoroutines):
|
||||
# Explicit opt-out.
|
||||
const nimCoroutines* = false
|
||||
else:
|
||||
# Autodetect coroutine support.
|
||||
const nimCoroutines* = false
|
||||
Loading…
Add table
Add a link
Reference in a new issue