headers: _mingw.h: Set __MSVCRT_VERSION__ to 0x00 for crtdll.dll builds

When gcc was compiled with crtdll config then it links binaries with
-lcrtdll instead of -lmsvcrt and predefines macro __CRTDLL__.

So when __MSVCRT_VERSION__ was not manually set and gcc is not going to use
-lmsvcrt then set __MSVCRT_VERSION__ to 0x00 to indicate that msvcrt.dll is
not used.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Pali Rohár 2022-03-06 02:32:16 +01:00 committed by Martin Storsjö
parent 5631becdbe
commit 0880a9e818

View File

@ -221,10 +221,12 @@ limitations in handling dllimport attribute. */
#ifndef __MSVCRT_VERSION__
/* High byte is the major version, low byte is the minor. */
# ifndef _UCRT
# define __MSVCRT_VERSION__ @DEFAULT_MSVCRT_VERSION@
# else
# if defined(__CRTDLL__)
# define __MSVCRT_VERSION__ 0x00
# elif defined(_UCRT)
# define __MSVCRT_VERSION__ 0xE00
# else
# define __MSVCRT_VERSION__ @DEFAULT_MSVCRT_VERSION@
# endif
#endif