From 52c0516f4e0a70f0ada650ba73dbb9d8a3f7a18b Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Fri, 26 Jan 2024 18:11:02 -0300 Subject: [PATCH] meson: Fix MSVC build post #1742 by ensuring it's set to standards compliant mode --- src/platforms/hosted/meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/platforms/hosted/meson.build b/src/platforms/hosted/meson.build index fbf07292fc1..20f77a4ab1c 100644 --- a/src/platforms/hosted/meson.build +++ b/src/platforms/hosted/meson.build @@ -69,6 +69,16 @@ bmda_deps = [] cc = is_cross_build ? cc_native : cc_host +# Ensure that MSVC is switched to standards compliant mode +if cc.get_define('_MSC_VER') != '' + standards_flags = [ + '/Zc:__STDC__', + '/D_CRT_DECLARE_NONSTDC_NAMES=1' + ] + + bmda_args += cc.get_supported_arguments(standards_flags) +endif + # Determine if we're on a MSYS2 environment of some kind # If the compiler is MSYS2 GCC or Clang (but not Clang-cl) if build_machine.system() == 'windows' and cc.get_define('__MINGW32__') == '1'