mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-01 11:34:43 +00:00
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:
@@ -74,7 +74,7 @@ elif defined(haiku):
|
||||
SIGPIPE* = cint(7)
|
||||
SIG_DFL* = cast[CSighandlerT](0)
|
||||
else:
|
||||
when NoFakeVars:
|
||||
when defined(nimscript):
|
||||
{.error: "SIGABRT not ported to your platform".}
|
||||
else:
|
||||
var
|
||||
|
||||
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
|
||||
@@ -146,7 +146,7 @@ proc closureIterSetupExc(e: ref Exception) {.compilerproc, inline.} =
|
||||
|
||||
# some platforms have native support for stack traces:
|
||||
const
|
||||
nativeStackTraceSupported* = (defined(macosx) or defined(linux)) and
|
||||
nativeStackTraceSupported = (defined(macosx) or defined(linux)) and
|
||||
not NimStackTrace
|
||||
hasSomeStackTrace = NimStackTrace or defined(nimStackTraceOverride) or
|
||||
(defined(nativeStackTrace) and nativeStackTraceSupported)
|
||||
|
||||
@@ -252,7 +252,7 @@ proc write*(f: File, s: string) {.tags: [WriteIOEffect], benign.} =
|
||||
raiseEIO("cannot write string to file")
|
||||
{.pop.}
|
||||
|
||||
when NoFakeVars:
|
||||
when defined(nimscript):
|
||||
when defined(windows):
|
||||
const
|
||||
IOFBF = cint(0)
|
||||
|
||||
Reference in New Issue
Block a user