diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/markdown/snippets/compiler_has_define.md | 10 | ||||
| -rw-r--r-- | docs/yaml/objects/compiler.yaml | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/markdown/snippets/compiler_has_define.md b/docs/markdown/snippets/compiler_has_define.md new file mode 100644 index 000000000..64de26b39 --- /dev/null +++ b/docs/markdown/snippets/compiler_has_define.md @@ -0,0 +1,10 @@ +## Compilers now have a `has_define` method + +This method returns true if the given preprocessor symbol is +defined, else false is returned. This is useful is cases where +an empty define has to be distinguished from a non-set one, which +is not possible using `get_define`. + +Additionally it makes intent clearer for code that only needs +to check if a specific define is set at all and does not care +about its value.
\ No newline at end of file diff --git a/docs/yaml/objects/compiler.yaml b/docs/yaml/objects/compiler.yaml index d5d7df569..977cbdf0d 100644 --- a/docs/yaml/objects/compiler.yaml +++ b/docs/yaml/objects/compiler.yaml @@ -327,6 +327,17 @@ methods: type: str description: The define to check. +- name: has_define + returns: bool + since: 1.3.0 + description: | + Returns true if the given preprocessor symbol is *defined*. + kwargs_inherit: compiler._common + posargs: + definename: + type: str + description: The define to check. + - name: compiles returns: bool description: Returns true if the code compiles. |
