From: Vitaly Lipatov <lav@etersoft.ru> When clang < 13 cross-compiles for Windows, it sets _MSC_VER to 1911 (< 1912). The #if/#elif chain in __config checked _MSC_VER < 1912 first, which prevented the elif branch from defining _LIBCPP_DEFER_NEW_TO_VCRUNTIME. This caused placement new/delete to be defined in both vcruntime_new.h and the libc++ <new> header, resulting in redefinition errors. Since Wine always provides aligned allocation operators in vcruntime_new.h, simply remove the _MSC_VER < 1912 cases and always define _LIBCPP_DEFER_NEW_TO_VCRUNTIME when using the Microsoft ABI with vcruntime. --- include/msvcrt/__config | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/msvcrt/__config b/include/msvcrt/__config index 78ff1b2ab4e..6585cd5fbde 100644 --- a/include/msvcrt/__config +++ b/include/msvcrt/__config @@ -990,11 +990,8 @@ template <unsigned> struct __static_assert_check {}; #define _DECLARE_C99_LDBL_MATH 1 #endif -// If we are getting operator new from the MSVC CRT, then allocation overloads -// for align_val_t were added in 19.12, aka VS 2017 version 15.3. -#if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912 -# define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION -#elif defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) +// If we are getting operator new from the MSVC CRT, defer to vcruntime. +#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME) # define _LIBCPP_DEFER_NEW_TO_VCRUNTIME # if !defined(__cpp_aligned_new) // We're defering to Microsoft's STL to provide aligned new et al. We don't -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10577