]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Ensure VxWorks headers expose C99 features for C++
authorOlivier Hainque <hainque@adacore.com>
Sat, 11 Dec 2021 08:46:08 +0000 (08:46 +0000)
committerOlivier Hainque <hainque@adacore.com>
Mon, 13 Dec 2021 13:54:11 +0000 (13:54 +0000)
C++ relies on C99 features since C++11 and libstdc++ down to c++98
checks for C99 features at configure time. Simpler is to request C99
features from system headers unconditionally.

2021-12-11  Olivier Hainque  <hainque@adacore.com>

* config/vxworks.h (VXWORKS_OS_CPP_BUILTINS): Define
_C99 for C++.

gcc/config/vxworks.h

index a89e3d68c62dab4c76d35effb48588243aa70ab4..f76141ffdca88aadba45a851da7193d6c3bda1c3 100644 (file)
@@ -286,6 +286,12 @@ extern void vxworks_asm_out_destructor (rtx symbol, int priority);
           if (!flag_isoc99 && !c_dialect_cxx())                        \
              builtin_define ("_ALLOW_KEYWORD_MACROS");                 \
         }                                                              \
+      /* C++ support relies on C99 features from C++11, even C++98     \
+         for listdc++ in particular, with corresponding checks at      \
+         configure time.  Make sure C99 features are exposed by the    \
+         system headers.  */                                           \
+      if (c_dialect_cxx())                                             \
+        builtin_define("_C99");                                                \
     }                                                                  \
   while (0)