https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100429

            Bug ID: 100429
           Summary: threading support on windows
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

It looks like libgcc DOES provide threading support for windows. However,
_GLIBCXX_HAS_GTHREADS does not get defined for libstdc++, I guess it is another
libtool issue.

SO GOOD, if we fix them, we will have our own threading support for GCC on
windows.


https://github.com/gcc-mirror/gcc/blob/master/libgcc/config/i386/gthr-win32.h


_GLIBCXX_HAS_GTHREADS

In file included from
d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr.h:148,
                 from b.cc:4:
d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr-default.h: In
function 'int __gthread_setspecific(__gthread_key_t, const void*)':
d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr-default.h:629:27:
error: types may not be defined in casts
  629 |   if (TlsSetValue (__key, CONST_CAST2(void *, const void *, __ptr)) !=
0)
      |                           ^~~~~~~~~~~

BTW. there is another bug in libgcc. This does not work.

An alternative code should be if (TlsSetValue (__key, void*( __ptr)) != 0)

Reply via email to