Jacek Caban (@jacek) commented about dlls/winecrt0/crt_dllmain.c:
#include <stdarg.h> #include <stdio.h> +#include <process.h> #include "windef.h" #include "winbase.h"
+#if defined(__GNUC__) +/* Reference: mingw-w64-crt: crt/gccmain.c */ +typedef void (*fnptr)(void); +extern fnptr __CTOR_LIST__[]; +extern fnptr __DTOR_LIST__[]; +#elif defined(_MSC_VER)
Those static libs are shipped in Wine and we don't really know what environment they are used with, so we aim to make those things work with mingw or clang msvc regardless of the compiler used to build Wine itself. In this case, even mingw-w64 supports both `.CRT` section and GCC-style constructor lists. Do you need GCC-style constructors for something? Maybe we could just make `.CRT` section work for everyone? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9265#note_119823