diff options
| author | Will Ayd <william.ayd@icloud.com> | 2025-04-09 16:39:54 -0400 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-04-09 16:52:23 -0400 |
| commit | a717554cdb726cf963556ecf6516f4386d5a879b (patch) | |
| tree | 10433e95ec8e2dbb098ad2b14b7122b654ed852f /docs/markdown/Compiler-properties.md | |
| parent | f23b0e7f35661645b7fec82025e72dffa189ab59 (diff) | |
| download | meson-a717554cdb726cf963556ecf6516f4386d5a879b.tar.gz | |
Add documentation for compiler.has_define to user guide
Diffstat (limited to 'docs/markdown/Compiler-properties.md')
| -rw-r--r-- | docs/markdown/Compiler-properties.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/markdown/Compiler-properties.md b/docs/markdown/Compiler-properties.md index 6d04c8bd7..7eea36891 100644 --- a/docs/markdown/Compiler-properties.md +++ b/docs/markdown/Compiler-properties.md @@ -194,6 +194,18 @@ correctly report the function as missing. Without the header however, it would lack the necessary availability information and incorrectly report the function as available. +## Is a macro defined? + +Macro detection can often be useful to determine if non-standard features +are supported on your target platform. Fortunately, Meson makes it +easy to check if a macro is defined: + +```meson +if [[#compiler.has_define]]('__SIZEOF_INT128__') + # macro is defined, do whatever is required +endif +``` + ## Does a structure contain a member? Some platforms have different standard structures. Here's how one |
