aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArsen Arsenović <arsen@aarsen.me>2024-10-18 23:14:58 +0200
committerArsen Arsenović <arsen@gcc.gnu.org>2024-11-21 23:48:49 +0100
commitffeee625c53d882171af436222a7b18ed9ed89e1 (patch)
tree2c26a975adb38c4e80a8cc8e5d77c7cf5beee66d /gcc
parent338d687e2a32f4e152d26c02319db1cb00401c3f (diff)
downloadgcc-ffeee625c53d882171af436222a7b18ed9ed89e1.zip
gcc-ffeee625c53d882171af436222a7b18ed9ed89e1.tar.gz
gcc-ffeee625c53d882171af436222a7b18ed9ed89e1.tar.bz2
doc/cpp: Document __has_include_next
While hacking on an unrelated change, I noticed that __has_include_next hasn't been documented at all. This patch adds it to the __has_include manual node. gcc/ChangeLog: * doc/cpp.texi (__has_include): Document __has_include_next also. (Conditional Syntax): Mention __has_include_next in the description for the __has_include menu entry.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/doc/cpp.texi40
1 files changed, 24 insertions, 16 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index a83aa26..970c0a3 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -3204,7 +3204,8 @@ directive}: @samp{#if}, @samp{#ifdef} or @samp{#ifndef}.
* @code{__has_builtin}::
* @code{__has_feature}::
* @code{__has_extension}::
-* @code{__has_include}::
+* @code{__has_include}:: @code{__has_include} and
+ @code{__has_include_next}
* @code{__has_embed}::
@end menu
@@ -3607,22 +3608,27 @@ details of which identifiers are accepted by these function-like macros, see
the Clang documentation}}.
@node @code{__has_include}
-@subsection @code{__has_include}
+@subsection @code{__has_include}, @code{__has_include_next}
@cindex @code{__has_include}
-
-The special operator @code{__has_include (@var{operand})} may be used in
-@samp{#if} and @samp{#elif} expressions to test whether the header referenced
-by its @var{operand} can be included using the @samp{#include} directive. Using
-the operator in other contexts is not valid. The @var{operand} takes
-the same form as the file in the @samp{#include} directive (@pxref{Include
-Syntax}) and evaluates to a nonzero value if the header can be included and
-to zero otherwise. Note that that the ability to include a header doesn't
-imply that the header doesn't contain invalid constructs or @samp{#error}
-directives that would cause the preprocessor to fail.
-
-The @code{__has_include} operator by itself, without any @var{operand} or
-parentheses, acts as a predefined macro so that support for it can be tested
-in portable code. Thus, the recommended use of the operator is as follows:
+@cindex @code{__has_include_next}
+
+The special operators @code{__has_include (@var{operand})} and
+@code{__has_include_next (@var{operand})} may be used in @samp{#if} and
+@samp{#elif} expressions to test whether the header referenced by their
+@var{operand} can be included using the @samp{#include} and
+@samp{#include_next} directive, respectively. Using the operators in
+other contexts is not valid. The @var{operand} takes the same form as
+the file in the @samp{#include} and @samp{#include_next} directives
+respectively (@pxref{Include Syntax}) and the operators evaluate to a
+nonzero value if the header can be included and to zero otherwise. Note
+that that the ability to include a header doesn't imply that the header
+doesn't contain invalid constructs or @samp{#error} directives that
+would cause the preprocessor to fail.
+
+The @code{__has_include} and @code{__has_include_next} operators by
+themselves, without any @var{operand} or parentheses, act as
+predefined macros so that support for them can be tested in portable
+code. Thus, the recommended use of the operators is as follows:
@smallexample
#if defined __has_include
@@ -3645,6 +3651,8 @@ but not with others that don't.
#endif
@end smallexample
+The same holds for @code{__has_include_next}.
+
@node @code{__has_embed}
@subsection @code{__has_embed}
@cindex @code{__has_embed}