summaryrefslogtreecommitdiff
path: root/docs/markdown/Compiler-properties.md
diff options
context:
space:
mode:
authorWill Ayd <william.ayd@icloud.com>2025-04-09 16:39:54 -0400
committerEli Schwartz <eschwartz93@gmail.com>2025-04-09 16:52:23 -0400
commita717554cdb726cf963556ecf6516f4386d5a879b (patch)
tree10433e95ec8e2dbb098ad2b14b7122b654ed852f /docs/markdown/Compiler-properties.md
parentf23b0e7f35661645b7fec82025e72dffa189ab59 (diff)
downloadmeson-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.md12
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