aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorMoody Liu <mooodyhunter@outlook.com>2023-09-05 00:47:48 +0800
committerXavier Claessens <xclaesse@gmail.com>2023-09-09 07:25:27 -0400
commit3c47216fe945a45834daa38f71e287dcfaf345c7 (patch)
treee208f26df2306a4080cbaa28db5f427b44e455f2 /docs/markdown/snippets
parent306efbd5b77abdc6ffca27bcb049f3196b7e3451 (diff)
downloadmeson-3c47216fe945a45834daa38f71e287dcfaf345c7.zip
meson-3c47216fe945a45834daa38f71e287dcfaf345c7.tar.gz
meson-3c47216fe945a45834daa38f71e287dcfaf345c7.tar.bz2
clike compilers: fix cross_* functions' include
A standard C library may not exist for cross-compile environments, thus the existence of <stdio.h> cannot be guaranteed. Use <stddef.h> instead, this header contains compiler-specific defines thus it usually comes from the compiler.
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/clike_compilers_implicit_includes.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/markdown/snippets/clike_compilers_implicit_includes.md b/docs/markdown/snippets/clike_compilers_implicit_includes.md
new file mode 100644
index 0000000..a26ec03
--- /dev/null
+++ b/docs/markdown/snippets/clike_compilers_implicit_includes.md
@@ -0,0 +1,13 @@
+## Clarify of implicitly-included headers in C-like compiler checks
+
+Compiler check methods `compiler.compute_int()`, `compiler.alignment()`
+and `compiler.sizeof()` now have their implicitly-included headers
+corrected and documented.
+
+`<stdio.h>` was included unintentionally when cross-compiling, which
+is less than ideal because there is no guarantee that a standard library
+is available for the target platform. Only `<stddef.h>` is included instead.
+
+For projects that depend on the old behavior, the compiler check methods
+have an optional argument `prefix`, which can be used to specify additional
+`#include` directives.