From: <sv...@op...> - 2024-07-22 18:23:24
|
Author: manx Date: Mon Jul 22 20:23:12 2024 New Revision: 21247 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21247 Log: [Fix] mpt/base/numbers.hpp: Work-around missing numbers header in Android NDK r23, r24, r25 (which do ship only libc++ 11). Modified: trunk/OpenMPT/src/mpt/base/detect_quirks.hpp trunk/OpenMPT/src/mpt/base/numbers.hpp Modified: trunk/OpenMPT/src/mpt/base/detect_quirks.hpp ============================================================================== --- trunk/OpenMPT/src/mpt/base/detect_quirks.hpp Mon Jul 22 19:54:14 2024 (r21246) +++ trunk/OpenMPT/src/mpt/base/detect_quirks.hpp Mon Jul 22 20:23:12 2024 (r21247) @@ -327,4 +327,10 @@ +#if MPT_OS_ANDROID && MPT_LIBCXX_LLVM_BEFORE(17000) +#define MPT_LIBCXX_QUIRK_NO_NUMBERS +#endif + + + #endif // MPT_BASE_DETECT_QUIRKS_HPP Modified: trunk/OpenMPT/src/mpt/base/numbers.hpp ============================================================================== --- trunk/OpenMPT/src/mpt/base/numbers.hpp Mon Jul 22 19:54:14 2024 (r21246) +++ trunk/OpenMPT/src/mpt/base/numbers.hpp Mon Jul 22 20:23:12 2024 (r21247) @@ -6,9 +6,10 @@ #include "mpt/base/detect_compiler.hpp" +#include "mpt/base/detect_quirks.hpp" #include "mpt/base/namespace.hpp" -#if MPT_CXX_AT_LEAST(20) +#if MPT_CXX_AT_LEAST(20) && !defined(MPT_LIBCXX_QUIRK_NO_NUMBERS) #include <numbers> #else #include <type_traits> @@ -25,7 +26,7 @@ namespace numbers { -#if MPT_CXX_AT_LEAST(20) +#if MPT_CXX_AT_LEAST(20) && !defined(MPT_LIBCXX_QUIRK_NO_NUMBERS) template <typename T> inline constexpr T e_v = std::numbers::e_v<T>; |