From 3c47216fe945a45834daa38f71e287dcfaf345c7 Mon Sep 17 00:00:00 2001 From: Moody Liu Date: Tue, 5 Sep 2023 00:47:48 +0800 Subject: clike compilers: fix cross_* functions' include A standard C library may not exist for cross-compile environments, thus the existence of cannot be guaranteed. Use instead, this header contains compiler-specific defines thus it usually comes from the compiler. --- docs/markdown/snippets/clike_compilers_implicit_includes.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/markdown/snippets/clike_compilers_implicit_includes.md (limited to 'docs/markdown') 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. + +`` 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 `` 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. -- cgit v1.1