+cpp_msvc_compat_args = []
+if cc.get_id() == 'msvc'
+ foreach a : ['/wd4018', # signed/unsigned mismatch
+ '/wd4056', # overflow in floating-point constant arithmetic
+ '/wd4244', # conversion from 'type1' to 'type2', possible loss of data
+ '/wd4267', # 'var' : conversion from 'size_t' to 'type', possible loss of data
+ '/wd4305', # trancation from 'type1' to 'type2'
+ '/wd4351', # new behavior: elements of array 'array' will be default initialized
+ '/wd4756', # overflow in constant arithmetic
+ '/wd4800', # forcing value to bool 'true' or 'false' (performance warning)
+ '/wd4996', # disabled deprecated POSIX name warnings
+ '/wd4291', # no matching operator delete found
+ '/wd4146', # unary minus operator applied to unsigned type, result still unsigned
+ '/wd4200', # nonstandard extension used: zero-sized array in struct/union
+ '/wd4624', # destructor was implicitly defined as deleted [from LLVM]
+ '/wd4309', # 'initializing': truncation of constant value
+ '/wd4838', # conversion from 'int' to 'const char' requires a narrowing conversion
+ '/we4020', # Error when passing the wrong number of parameters
+ '/we4024', # Error when passing different type of parameter
+ ]
+ if cc.has_argument(a)
+ c_args += a
+ endif
+ if cpp.has_argument(a)
+ cpp_args += a
+ endif
+ endforeach
+ if cc.has_argument('-Wmicrosoft-enum-value') # Clang
+ c_args += '-Wno-microsoft-enum-value'
+ cpp_args += '-Wno-microsoft-enum-value'