diff options
author | Oscar NihlgÄrd <oscarnihlgard@gmail.com> | 2019-02-03 09:06:00 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-02-03 09:06:00 +0100 |
commit | 0091f2ad3bfa57aa1d5bdd1a1062975135a2a6d9 (patch) | |
tree | 1760f6fc1779cfcf01634109f78df3606baf53ba /doc/manual.rst | |
parent | 07553034de5bd9ffa89df303bf789664f9cb8ed8 (diff) | |
download | Nim-0091f2ad3bfa57aa1d5bdd1a1062975135a2a6d9.tar.gz |
Implement {.booldefine.} (#10533)
Diffstat (limited to 'doc/manual.rst')
-rw-r--r-- | doc/manual.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/manual.rst b/doc/manual.rst index 170f0d550..bcb1581dd 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -7851,6 +7851,7 @@ pragma description ================= ============================================ `intdefine`:idx: Reads in a build-time define as an integer `strdefine`:idx: Reads in a build-time define as a string +`booldefine`:idx: Reads in a build-time define as a bool ================= ============================================ .. code-block:: nim @@ -7858,13 +7859,14 @@ pragma description echo FooBar :: - nim c -d:FooBar=42 foobar.c + nim c -d:FooBar=42 foobar.nim In the above example, providing the -d flag causes the symbol ``FooBar`` to be overwritten at compile time, printing out 42. If the ``-d:FooBar=42`` were to be omitted, the default value of 5 would be -used. +used. To see if a value was provided, `defined(FooBar)` can be used. +The syntax `-d:flag` is actually just a shortcut for `-d:flag=true`. Custom annotations ------------------ |