On Fri, Oct 30, 2026 at 9:29 AM Jakub Jelinek <[email protected]> wrote:
> If you want to handle C99 too even without the HAVE_LONG_LONG macro being
> defined, just do
> #if (defined(HAVE_LONG_LONG) \
>      || __STDC_VERSION__ >= 199901L \
>      || __cplusplus >= 201103L)
> I don't think you need to use defined(__cplusplus) &&, like you don't use
> #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
> earlier.

Note that libiberty.h use ansidecl.h and ansidecl.h has:
#if defined(__cplusplus) && __cplusplus >= 201103
and does not check for defined(__STDC_VERSION__) in
#if (!defined(__cplusplus) && __STDC_VERSION__ >= 199901L) ||
defined(__cplusplus) || (defined(__SUNPRO_C) &&
defined(__C99FEATURES__)).
I copied that logic and also due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128228#c7 and
https://gcc.gnu.org/pipermail/gcc-patches/2026-October/734135.html
that says libiberty may be used with non sane compiler.

Reply via email to