Skip to content

Commit

Permalink
[Ref] mpt/base/detect_quirks.hpp: Add MPT_LIBCXX_QUIRK_NO_CHRONO_DATE…
Browse files Browse the repository at this point in the history
… to disable std::chrono date handling completely for MSVC when targeting Windows earlier than Windows 10 1903 due to <microsoft/STL#1911> and <microsoft/STL#2163>.

[Ref] mpt/base/detect_quirks.hpp: Add MPT_LIBCXX_QUIRK_NO_CHRONO_DATE_PARSE tp disable std::chrono for date parsing in VS2022 due to <https://developercommunity.visualstudio.com/t/stdchronoget-tzdb-list-memory-leak/1644641> / <microsoft/STL#2504>.


git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@17377 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed May 27, 2022
1 parent 70b0709 commit 4ef4193
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/mpt/base/detect_quirks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,35 @@



#if MPT_CXX_AT_LEAST(20)
#if MPT_LIBCXX_MS && MPT_OS_WINDOWS
#if defined(NTDDI_VERSION)
#if (NTDDI_VERSION < 0x0A000007) // < Windows 10 1903
// std::chrono timezones require Windows 10 1903 with VS2022 as of 2022-01-22.
// See <https://github.com/microsoft/STL/issues/1911> and
// <https://github.com/microsoft/STL/issues/2163>.
#define MPT_LIBCXX_QUIRK_NO_CHRONO_DATE
#endif
#else
#define MPT_LIBCXX_QUIRK_NO_CHRONO_DATE
#endif
#endif
#if MPT_LIBCXX_GNU_BEFORE(11)
#define MPT_LIBCXX_QUIRK_NO_CHRONO_DATE
#elif MPT_LIBCXX_LLVM_BEFORE(7000)
#define MPT_LIBCXX_QUIRK_NO_CHRONO_DATE
#endif
#if MPT_LIBCXX_MS && (MPT_MSVC_BEFORE(2022, 2) || !MPT_COMPILER_MSVC)
// Causes massive memory leaks.
// See
// <https://developercommunity.visualstudio.com/t/stdchronoget-tzdb-list-memory-leak/1644641>
// / <https://github.com/microsoft/STL/issues/2504>.
#define MPT_LIBCXX_QUIRK_NO_CHRONO_DATE_PARSE
#elif MPT_LIBCXX_GNU
#define MPT_LIBCXX_QUIRK_NO_CHRONO_DATE_PARSE
#endif
#endif



#endif // MPT_BASE_DETECT_QUIRKS_HPP

0 comments on commit 4ef4193

Please sign in to comment.