__has_embed
¶The special operator __has_embed (operands)
may be used in
‘#if’ and ‘#elif’ expressions to test whether a binary resource
specified by the first operand with optional ‘#embed’ parameters can
be included using the ‘#embed’ directive (see Binary Resource Inclusion) with the same parameters. The operator returns
__STDC_EMBED_NOT_FOUND__
if either the binary resource does not exist
or at least one of the parameters is not supported by the implementation,
__STDC_EMBED_FOUND__
if all the parameters are supported and the
resource is not empty and finally __STDC_EMBED_EMPTY__
if all the
parameters are supported and the resource is empty.
The support of __has_embed
operator can be tested with ‘#ifdef’
etc. similarly to __has_include
and the same rules on how to
test it apply. __FILE__
can be often used to test if an
implementation supports some implementation defined parameter, e.g.
#ifdef __has_embed #if __has_embed (__FILE__ limit (4) myvendor::myattr (42)) != __STDC_EMBED_NOT_FOUND__ #embed "foo.dat" limit (4) myvendor::myattr (42) #endif #endif
The __has_embed
operator is not supported in the Traditional Mode
(see Traditional Mode).