https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104654
Bug ID: 104654 Summary: Errors in gthread.d when building against MinGW-w64 with --enable-threads=posix Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: brechtsanders at users dot sourceforge.net Target Milestone: --- When building GCC (recently tried 11.2 snapshot 20220219) against MinGW-w64 with --enable-threads=posix the following D compiler errors occur: r:\winlibs64-11.2.0ucrt\gcc-11-20220219\libphobos\libdruntime\gcc\gthread.d:46:30: error: undefined identifier 'PTHREAD_ONCE_INIT', did you mean variable 'GTHREAD_ONCE_INIT'? 46 | enum GTHREAD_ONCE_INIT = PTHREAD_ONCE_INIT; | ^ r:\winlibs64-11.2.0ucrt\gcc-11-20220219\libphobos\libdruntime\gcc\gthread.d:44:29: error: undefined identifier 'pthread_key_t' 44 | alias __gthread_key_t = pthread_key_t; | ^ r:\winlibs64-11.2.0ucrt\gcc-11-20220219\libphobos\libdruntime\gcc\gthread.d:45:30: error: undefined identifier 'pthread_once_t' 45 | alias __gthread_once_t = pthread_once_t; | ^ >From what I gather things like pthread_key_t and pthread_once_t should probably be defined in libphobos/libdruntime/core/sys/posix/sys/types.d and PTHREAD_ONCE_INIT in libphobos/libdruntime/core/sys/posix/pthread.d I noticed in libphobos/libdruntime/core/sys/posix/sys/types.d there is no specific version() case for Windows/MinGW with POSIX threads.