From 9649eee307d15321010ab60a89d79fe31a9863a4 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sat, 22 Nov 2025 01:05:35 +0800 Subject: [PATCH] meson: Use /Zc:enumTypes enables C++ conforming enum underlying type and enumerator type deduction The detail is at https://learn.microsoft.com/en-us/cpp/build/reference/zc-enumtypes?view=msvc-170 For example: enum Enum { A = 'A', B = sizeof(A) }; static_assert(B == 1); // previously failed, now succeeds under /Zc:enumTypes Signed-off-by: Yonggang Luo Part-of: --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index aecca8fda00..ef0e5b0ddd6 100644 --- a/meson.build +++ b/meson.build @@ -1169,6 +1169,7 @@ if cc.get_argument_syntax() == 'msvc' '/we4024', # Error when passing different type of parameter '/we4189', # 'identifier' : local variable is initialized but not referenced '/Zc:__cplusplus', #Set __cplusplus macro to match the /std:c++ on the command line + '/Zc:enumTypes', # Enables C++ conforming enum underlying type and enumerator type deduction '/Zc:preprocessor', # Use the standards-conforming preprocessor ] c_args += cc.get_supported_arguments(_trial)