NoDecl pragma

The noDecl pragma can be applied to almost any symbol (variable, proc, type, etc.) and is sometimes useful for interoperability with C: It tells Nim that it should not generate a declaration for the symbol in the C code. For example:

  1. var
  2. EACCES {.importc, noDecl.}: cint # pretend EACCES was a variable, as
  3. # Nim does not know its value

However, the header pragma is often the better alternative.

Note: This will not work for the LLVM backend.