Jacek Caban (@jacek) commented about dlls/msvcr80/tests/msvcr80.c:
static int (__cdecl *p_strncmp)(const char *, const char *, size_t); static int (__cdecl *p_dupenv_s)(char **, size_t *, const char *); static int (__cdecl *p_wdupenv_s)(wchar_t **, size_t *, const wchar_t *); +static int* (__cdecl *p_errno)(void);
+/* make sure we use the correct errno */ +#undef errno +#define errno (*p_errno())
We could also just link tests to msvcr80 instead of msvcrt, something like https://gitlab.winehq.org/jacek/wine/-/commit/49b8bb9503980daff540594ef4d0d1... should do the trick.