ports/emulators/rpcs3/files/patch-libc++8
Jan Beich 24cf6b180f emulators/rpcs3: unbreak on FreeBSD < 11.4/12.2 after r540845
Utilities/bin_patch.cpp:788:25: error: no member named 'contains' in 'std::__1::set<std::__1::basic_string<char>, std::__1::less<std::__1::basic_string<char> >, std::__1::allocator<std::__1::basic_string<char> > >'
                        if (m_applied_groups.contains(patch.patch_group))
                            ~~~~~~~~~~~~~~~~ ^
rpcs3/rpcs3qt/patch_manager_dialog.cpp:338:120: error: no member named 'contains' in 'std::__1::set<std::__1::basic_string<char>, std::__1::less<std::__1::basic_string<char> >, std::__1::allocator<std::__1::basic_string<char> > >'
                                        (m_owned_games.find(serial) == m_owned_games.end() || (app_version != patch_key::all && !m_owned_games.at(serial).contains(app_version))))
                                                                                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~ ^
2020-06-30 06:11:00 +00:00

287 lines
11 KiB
Text

Drop after FreeBSD 11.3/12.1 EOL.
https://reviews.llvm.org/rL359211
https://reviews.llvm.org/rL364862
https://reviews.llvm.org/rL366170
rpcs3/Emu/Io/PadHandler.cpp:191:27: error: no member named 'lerp' in namespace 'std'
const float pos = std::lerp(0.13f, 1.f, (mag - dzRange) / (1 - dzRange));
~~~~~^
rpcs3/Emu/Io/PadHandler.cpp:198:27: error: no member named 'lerp' in namespace 'std'
const float pos = std::lerp(0.f, 0.13f, mag / dzRange);
~~~~~^
In file included from rpcs3/Emu/System.cpp:9:
rpcs3/Emu/Cell/PPUOpcodes.h:66:14: error: no member named 'rotr' in namespace 'std'
return std::rotr<u64>(~0ull << (~(me - mb) & 63), mb & 63);
~~~~~^
rpcs3/Emu/Cell/PPUOpcodes.h:66:19: error: unexpected type name 'u64': expected expression
return std::rotr<u64>(~0ull << (~(me - mb) & 63), mb & 63);
^
rpcs3/Emu/Cell/PPUOpcodes.h:66:30: warning: expression result unused [-Wunused-value]
return std::rotr<u64>(~0ull << (~(me - mb) & 63), mb & 63);
~~~~~ ^ ~~~~~~~~~~~~~~~~~
rpcs3/Emu/Cell/PPUOpcodes.h:64:15: error: no return statement in constexpr function
constexpr u64 ppu_rotate_mask(u32 mb, u32 me)
^
rpcs3/Emu/Cell/PPUOpcodes.h:71:14: error: no member named 'rotr' in namespace 'std'
return std::rotr<u32>(inst, 26) & 0x1ffff; // Rotate + mask
~~~~~^
rpcs3/Emu/Cell/PPUOpcodes.h:71:19: error: unexpected type name 'u32': expected expression
return std::rotr<u32>(inst, 26) & 0x1ffff; // Rotate + mask
^
rpcs3/Emu/Cell/PPUOpcodes.h:71:24: warning: expression result unused [-Wunused-value]
return std::rotr<u32>(inst, 26) & 0x1ffff; // Rotate + mask
^~~~
rpcs3/Emu/Cell/PPUOpcodes.h:69:15: error: no return statement in constexpr function
constexpr u32 ppu_decode(u32 inst)
^
In file included from rpcs3/Emu/System.cpp:11:
rpcs3/Emu/Cell/PPUAnalyser.h:992:16: error: no member named 'countr_zero' in namespace 'std'
return std::countr_zero(mask());
~~~~~^
rpcs3/Emu/Cell/PPUAnalyser.h:1241:35: error: no member named 'countl_zero' in namespace 'std'
const u64 mix = ~0ull >> std::countl_zero(min ^ max);
~~~~~^
Utilities/bin_patch.cpp:788:25: error: no member named 'contains' in 'std::__1::set<std::__1::basic_string<char>, std::__1::less<std::__1::basic_string<char> >, std::__1::allocator<std::__1::basic_string<char> > >'
if (m_applied_groups.contains(patch.patch_group))
~~~~~~~~~~~~~~~~ ^
rpcs3/rpcs3qt/patch_manager_dialog.cpp:338:120: error: no member named 'contains' in 'std::__1::set<std::__1::basic_string<char>, std::__1::less<std::__1::basic_string<char> >, std::__1::allocator<std::__1::basic_string<char> > >'
(m_owned_games.find(serial) == m_owned_games.end() || (app_version != patch_key::all && !m_owned_games.at(serial).contains(app_version))))
~~~~~~~~~~~~~~~~~~~~~~~~ ^
--- Utilities/bin_patch.cpp.orig 2020-06-29 22:45:17 UTC
+++ Utilities/bin_patch.cpp
@@ -785,7 +785,11 @@ std::size_t patch_engine::apply_patch(const std::strin
{
if (!patch.patch_group.empty())
{
+#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 9000
+ if (m_applied_groups.find(patch.patch_group) != m_applied_groups.end())
+#else
if (m_applied_groups.contains(patch.patch_group))
+#endif
{
continue;
}
--- Utilities/types.h.orig 2020-04-16 09:59:19 UTC
+++ Utilities/types.h
@@ -102,6 +102,203 @@ namespace std
}
#endif
+#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 9000
+_LIBCPP_BEGIN_NAMESPACE_STD
+template <typename _Fp>
+constexpr
+_Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept {
+ if ((__a <= 0 && __b >= 0) || (__a >= 0 && __b <= 0))
+ return __t * __b + (1 - __t) * __a;
+
+ if (__t == 1) return __b;
+ const _Fp __x = __a + __t * (__b - __a);
+ if (__t > 1 == __b > __a)
+ return __b < __x ? __x : __b;
+ else
+ return __x < __b ? __x : __b;
+}
+
+constexpr float
+lerp(float __a, float __b, float __t) _NOEXCEPT { return __lerp(__a, __b, __t); }
+
+constexpr double
+lerp(double __a, double __b, double __t) _NOEXCEPT { return __lerp(__a, __b, __t); }
+
+constexpr long double
+lerp(long double __a, long double __b, long double __t) _NOEXCEPT { return __lerp(__a, __b, __t); }
+
+template <class _Tp>
+using __bitop_unsigned_integer = integral_constant<bool,
+ is_integral<_Tp>::value &&
+ is_unsigned<_Tp>::value &&
+ !is_same<typename remove_cv<_Tp>::type, bool>::value &&
+ !is_same<typename remove_cv<_Tp>::type, signed char>::value &&
+ !is_same<typename remove_cv<_Tp>::type, wchar_t>::value &&
+ !is_same<typename remove_cv<_Tp>::type, char16_t>::value &&
+ !is_same<typename remove_cv<_Tp>::type, char32_t>::value
+ >;
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp __rotl(_Tp __t, unsigned int __cnt) _NOEXCEPT
+{
+ static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotl requires unsigned");
+ const unsigned int __dig = numeric_limits<_Tp>::digits;
+ if ((__cnt % __dig) == 0)
+ return __t;
+ return (__t << (__cnt % __dig)) | (__t >> (__dig - (__cnt % __dig)));
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+_Tp __rotr(_Tp __t, unsigned int __cnt) _NOEXCEPT
+{
+ static_assert(__bitop_unsigned_integer<_Tp>::value, "__rotr requires unsigned");
+ const unsigned int __dig = numeric_limits<_Tp>::digits;
+ if ((__cnt % __dig) == 0)
+ return __t;
+ return (__t >> (__cnt % __dig)) | (__t << (__dig - (__cnt % __dig)));
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+int __countr_zero(_Tp __t) _NOEXCEPT
+{
+ static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_zero requires unsigned");
+ if (__t == 0)
+ return numeric_limits<_Tp>::digits;
+
+ if (sizeof(_Tp) <= sizeof(unsigned int))
+ return __ctz(static_cast<unsigned int>(__t));
+ else if (sizeof(_Tp) <= sizeof(unsigned long))
+ return __ctz(static_cast<unsigned long>(__t));
+ else if (sizeof(_Tp) <= sizeof(unsigned long long))
+ return __ctz(static_cast<unsigned long long>(__t));
+ else
+ {
+ int __ret = 0;
+ int __iter = 0;
+ const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits;
+ while ((__iter = __ctz(static_cast<unsigned long long>(__t))) == __ulldigits)
+ {
+ __ret += __iter;
+ __t >>= __ulldigits;
+ }
+ return __ret + __iter;
+ }
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+int __countl_zero(_Tp __t) _NOEXCEPT
+{
+ static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_zero requires unsigned");
+ if (__t == 0)
+ return numeric_limits<_Tp>::digits;
+
+ if (sizeof(_Tp) <= sizeof(unsigned int))
+ return __clz(static_cast<unsigned int>(__t))
+ - (numeric_limits<unsigned int>::digits - numeric_limits<_Tp>::digits);
+ else if (sizeof(_Tp) <= sizeof(unsigned long))
+ return __clz(static_cast<unsigned long>(__t))
+ - (numeric_limits<unsigned long>::digits - numeric_limits<_Tp>::digits);
+ else if (sizeof(_Tp) <= sizeof(unsigned long long))
+ return __clz(static_cast<unsigned long long>(__t))
+ - (numeric_limits<unsigned long long>::digits - numeric_limits<_Tp>::digits);
+ else
+ {
+ int __ret = 0;
+ int __iter = 0;
+ const unsigned int __ulldigits = numeric_limits<unsigned long long>::digits;
+ while (true) {
+ __t = __rotr(__t, __ulldigits);
+ if ((__iter = __countl_zero(static_cast<unsigned long long>(__t))) != __ulldigits)
+ break;
+ __ret += __iter;
+ }
+ return __ret + __iter;
+ }
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+int __countl_one(_Tp __t) _NOEXCEPT
+{
+ static_assert(__bitop_unsigned_integer<_Tp>::value, "__countl_one requires unsigned");
+ return __t != numeric_limits<_Tp>::max()
+ ? __countl_zero(static_cast<_Tp>(~__t))
+ : numeric_limits<_Tp>::digits;
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+int __countr_one(_Tp __t) _NOEXCEPT
+{
+ static_assert(__bitop_unsigned_integer<_Tp>::value, "__countr_one requires unsigned");
+ return __t != numeric_limits<_Tp>::max()
+ ? __countr_zero(static_cast<_Tp>(~__t))
+ : numeric_limits<_Tp>::digits;
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
+rotl(_Tp __t, unsigned int __cnt) noexcept
+{
+ return __rotl(__t, __cnt);
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<__bitop_unsigned_integer<_Tp>::value, _Tp>
+rotr(_Tp __t, unsigned int __cnt) noexcept
+{
+ return __rotr(__t, __cnt);
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+countl_zero(_Tp __t) noexcept
+{
+ return __countl_zero(__t);
+}
+
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+countl_one(_Tp __t) noexcept
+{
+ return __countl_one(__t);
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+countr_zero(_Tp __t) noexcept
+{
+ return __countr_zero(__t);
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+countr_one(_Tp __t) noexcept
+{
+ return __countr_one(__t);
+}
+
+template<class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<__bitop_unsigned_integer<_Tp>::value, int>
+popcount(_Tp __t) noexcept
+{
+ return __popcount(__t);
+}
+_LIBCPP_END_NAMESPACE_STD
+#endif
+
using schar = signed char;
using uchar = unsigned char;
using ushort = unsigned short;
--- rpcs3/rpcs3qt/patch_manager_dialog.cpp.orig 2020-06-29 22:45:17 UTC
+++ rpcs3/rpcs3qt/patch_manager_dialog.cpp
@@ -335,7 +335,11 @@ void patch_manager_dialog::filter_patches(const QStrin
const std::string app_version = item->data(0, app_version_role).toString().toStdString();
if (serial != patch_key::all &&
+#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 9000
+ (m_owned_games.find(serial) == m_owned_games.end() || (app_version != patch_key::all && !(m_owned_games.at(serial).find(app_version) != m_owned_games.at(serial).end()))))
+#else
(m_owned_games.find(serial) == m_owned_games.end() || (app_version != patch_key::all && !m_owned_games.at(serial).contains(app_version))))
+#endif
{
item->setHidden(true);
return 0;