[vlc-commits] [Git][videolan/vlc][master] contrib: Fix the check for _UCRT

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jul 30 10:27:44 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5bffcca2 by Martin Storsjö at 2024-07-30T09:10:01+00:00
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.

- - - - -


1 changed file:

- contrib/src/main.mak


Changes:

=====================================
contrib/src/main.mak
=====================================
@@ -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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5bffcca2d211e5fb0720a7d772ad5e558349884f

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5bffcca2d211e5fb0720a7d772ad5e558349884f
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list