https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63287
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:1d9a8675d379f02f5e39639f469ae8dfcf33fea9 commit r11-5017-g1d9a8675d379f02f5e39639f469ae8dfcf33fea9 Author: Jakub Jelinek <ja...@redhat.com> Date: Fri Nov 13 23:23:33 2020 +0100 c++: Predefine __STDCPP_THREADS__ in the compiler if thread model is not single [PR63287] The following patch predefines __STDCPP_THREADS__ macro to 1 if c++11 or later and thread model (e.g. printed by gcc -v) is not single. There are two targets not handled by this patch, those that define THREAD_MODEL_SPEC. In one case - QNX - it looks just like a mistake to me, instead of setting thread_model=posix in config.gcc it uses THREAD_MODEL_SPEC macro to set it unconditionally to posix. The other is hpux10, which uses -threads option to decide if threads are enabled or not, but that option isn't really passed to the compiler. I think that is something that really should be solved in config/pa/ instead, e.g. in the config/xxx/xxx-c.c targets usually set their own predefined macros and it could handle this, and either pass the option also to the compiler, or say predefine __STDCPP_THREADS__ if _DCE_THREADS macro is defined already (or -D_DCE_THREADS found on the command line), or whatever else. 2020-11-13 Jakub Jelinek <ja...@redhat.com> PR c++/63287 * c-cppbuiltin.c: Include configargs.h. (c_cpp_builtins): For C++11 and later if THREAD_MODEL_SPEC is not defined, predefine __STDCPP_THREADS__ to 1 unless thread_model is "single".