12.6 Has_builtin Operator
The __has_builtin operator evaluates to a constant integer that can be
used in integer contexts, such as the conditional expressions to the
#if and #elif preprocessor directives, to test
whether the compiler recognizes the operator's argument as the name of a built-in
function in the current language and conformance mode. A nonzero value is yielded if the
argument is a recognized built-in function; zero otherwise.
The
__has_builtin operator by itself, without any operand or
parentheses, acts like a predefined macro, so that code can test for its validity in a
portable way. For
example:#if defined __has_builtin
# if __has_builtin (__builtin_object_size)
# define builtin_object_size(ptr) __builtin_object_size (ptr, 2)
# endif
#endif
#ifndef builtin_object_size
# define builtin_object_size(ptr) ((size_t)-1)
#endif 