Skip to content
Snippets Groups Projects
Commit 5bffcca2 authored by Martin Storsjö's avatar Martin Storsjö Committed by Steve Lhomme
Browse files

contrib: Fix the check for _UCRT

_UCRT is not a compiler internal define. Some build scripts may be
invoking the compiler with an explicit -D_UCRT, but if not, the
toolchain default is set by the toolchain headers. Therefore, include
crtdefs.h to pull in default headers for checking whether it is set
or not.

Also check for older forms of mingw-w64, which didn't use the
define _UCRT to signal the type of CRT.
parent 21a2e224
No related branches found
No related tags found
1 merge request!5788contrib: Fix the check for _UCRT
Pipeline #497245 passed with stage
in 47 minutes and 31 seconds
......@@ -211,7 +211,14 @@ BUILDLDFLAGS ?= $(BUILDCFLAGS)
# Do not export variables above! Use HOSTVARS or BUILDVARS.
ifdef HAVE_WIN32
ifneq ($(call cppcheck, _UCRT),)
define UCRT_HEADER_CHECK :=
#include <crtdefs.h> \n
#if defined(_UCRT) || (__MSVCRT_VERSION__ >= 0x1400) || (__MSVCRT_VERSION__ >= 0xE00 && __MSVCRT_VERSION__ < 0x1000) \n
# undef _UCRT \n
# define _UCRT \n
#endif \n
endef
ifneq ($(call cppcheck, _UCRT, $(UCRT_HEADER_CHECK)),)
HAVE_UCRT = 1
endif
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment