在 2023/11/9 00:51, Antonin Décimo 写道:
I've looked for the __STDC_NO_THREADS__ string in the latest mingw-w64 sources, but could not find it. It would be useful to me to have this macro defined, to write portable C code across platforms, compilers, and to make the code work on C23.Is it possible to add it? Where would be the best location?
I think we can add a dummy 'threads.h' that contains solely: ``` #define __STDC_NO_THREADS__ 1 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 and not C++ */ # define thread_local _Thread_local #endif ``` ISO C seems to require it to be a predefined macro without inclusion of any headers (6.10.81 Predefined macro names, N1570, ISO/IEC 9899:201x), but that will have to be done in the compiler and I don't think it has something to do with the compiler.
-- Best regards, LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
