https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108225
--- Comment #24 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > Maybe we want something like this: > > diff --git a/libstdc++-v3/config/os/mingw32-w64/os_defines.h > b/libstdc++-v3/config/os/mingw32-w64/os_defines.h > index ee02ff82e86..68ac100acc8 100644 > --- a/libstdc++-v3/config/os/mingw32-w64/os_defines.h > +++ b/libstdc++-v3/config/os/mingw32-w64/os_defines.h > @@ -96,4 +96,13 @@ > // See libstdc++/94268 > #define _GLIBCXX_BUFSIZ 4096 > > +#if _WIN32_WINNT < 0x0600 > +// For the win32 thread model, setting _WIN32_WINNT to an old version might > +// invalidate the value of _GLIBCXX_HAS_GTHREADS decided during configure. > +# include <gthr.h> > +# ifndef __GTHREADS_CXX0X > +# undef _GLIBCXX_HAS_GTHREADS > +# endif > +#endif > + > #endif IMO either you do not test _WIN32_WINNT but just __GTHREADS_CXX0X, or you just test _WIN32_WINNT and avoiding including <gthr.h> & testing __GTHREADS_CXX0X.