Consts defined by the compiler - nim-lang/Nim GitHub Wiki
Defined
The following three lists are compiled from: Nim/compiler/platform.nim and Nim/compiler/extccomp.nim
One can use some name from them like:
when defined(Windows):
doSomething()
Operating Systems:
DOSWindowsOS2LinuxMorphOSSkyOSSolarisIrixNetBSDFreeBSDOpenBSDAIXPalmOSQNXAmigaAtariNetwareMacOSMacOSXHaikuVxWorksJSNimrodVM(also seenimvmhere)Standalone
CPU Architectures:
i386m68kalphapowerpcpowerpc64sparcvmia64amd64mipsarmjsnimrodvm(also seenimvmhere)avr
Compilers:
vccMicrosoft's Visual C++gccGnu Cllvm_gccLLVM-GCC compilericcIntel C++ compilerclangClang compilerbccBorland C CompilerdmcDigital Mars C CompilerwccWatcom C CompilertccTiny C CompilerpccPelles C CompileruccGeneric UNIX C compiler
compileOption
Also remember about how to access the compiler options:
when compileOption("boundChecks"): # d:release should disable this.
if i > q.high: # x < q.low is taken care by the Natural parameter
raise newException(IndexError, "Bla has less than " & $(i+1) & " elements.")
discard
TODO: List them here and how to correctly access the more complex ones.