Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
audio/audacity: Fix build in 12 and 13
Conditional workaround for the problem with old libc++ and the buggy implementation of std::conjunction Patch by tatsuki_makino@hotmail.com PR: 275192
- Loading branch information
1 parent
4e2c038
commit 01b1ed5
Showing
4 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
audio/audacity/files/extra-libraries_lib-utility_TypeList.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- libraries/lib-utility/TypeList.cpp.orig 2023-11-16 11:58:21 UTC | ||
+++ libraries/lib-utility/TypeList.cpp | ||
@@ -118,16 +118,16 @@ static_assert(Is_v<NullOrStartsWithInt, Nil>); | ||
static_assert(Is_v<NullOrStartsWithInt, Example>); | ||
|
||
static_assert(Every_v<Fn<is_arithmetic>, Example>); | ||
-static_assert(is_base_of_v<true_type, Every<Fn<is_arithmetic>, Example>>); | ||
+static_assert(TypeList::is_base_of_v<true_type, Every<Fn<is_arithmetic>, Example>>); | ||
static_assert(!Every_v<Fn<is_integral>, Example>); | ||
-static_assert(is_base_of_v<is_integral<double>, | ||
+static_assert(TypeList::is_base_of_v<is_integral<double>, | ||
Every<Fn<is_integral>, Example>>); | ||
|
||
static_assert(Some_v<Fn<is_integral>, Example>); | ||
-static_assert(is_base_of_v<is_integral<int>, | ||
+static_assert(TypeList::is_base_of_v<is_integral<int>, | ||
Some<Fn<is_integral>, Example>>); | ||
static_assert(!Some_v<Fn<is_void>, Example>); | ||
-static_assert(is_base_of_v<false_type, Some<Fn<is_void>, Example>>); | ||
+static_assert(TypeList::is_base_of_v<false_type, Some<Fn<is_void>, Example>>); | ||
|
||
static_assert(NotEvery_v<Fn<is_floating_point>, Example>); | ||
static_assert(NotAny_v<Fn<is_void>, Example>); |
39 changes: 39 additions & 0 deletions
39
audio/audacity/files/extra-libraries_lib-utility_TypeList.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- libraries/lib-utility/TypeList.h.orig 2023-11-16 11:58:21 UTC | ||
+++ libraries/lib-utility/TypeList.h | ||
@@ -54,6 +54,18 @@ namespace TypeList { | ||
can make compound predicates out of simpler ones. | ||
*/ | ||
|
||
+template <class...> | ||
+struct conjunction : std::true_type {}; | ||
+ | ||
+template <class _Arg> | ||
+struct conjunction<_Arg> : _Arg {}; | ||
+ | ||
+template <class _Arg, class... _Args> | ||
+struct conjunction<_Arg, _Args...> : std::conditional_t<!bool(_Arg::value), _Arg, conjunction<_Args...>> {}; | ||
+ | ||
+template <class _Bp, class _Dp> | ||
+inline constexpr bool is_base_of_v = __is_base_of(_Bp, _Dp); | ||
+ | ||
//! standard in C++20; add a level of indirection to a type | ||
template<typename T> struct type_identity { using type = T; }; | ||
|
||
@@ -429,7 +441,7 @@ struct And<Predicate, Predicates...> { (private) | ||
static constexpr bool value = Is_v<And<Predicates...>, T>; | ||
}; | ||
public: | ||
- template<typename T> using typemap = typename std::conjunction< | ||
+ template<typename T> using typemap = typename TypeList::conjunction< | ||
typename Predicate::template typemap<T>, Rest<T> | ||
>; | ||
}; | ||
@@ -437,7 +449,7 @@ struct And<Predicate, Predicates...> { (private) | ||
//! Derived from the Predicate, applied to the first of the types (often boolean | ||
//! constant types), for which the value is false; or std::true_type | ||
template<typename Predicate, typename TypeList> struct Every | ||
- : Apply_t<std::conjunction, Map_t<Predicate, TypeList>> {}; | ||
+ : Apply_t<conjunction, Map_t<Predicate, TypeList>> {}; | ||
//! The constant value in the corresponding type | ||
template<typename Predicate, typename TypeList> constexpr auto Every_v = | ||
Every<Predicate, TypeList>::value; |
20 changes: 20 additions & 0 deletions
20
audio/audacity/files/extra-libraries_lib-utility_TypeSwitch.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- libraries/lib-utility/TypeSwitch.h.orig 2023-11-16 11:58:21 UTC | ||
+++ libraries/lib-utility/TypeSwitch.h | ||
@@ -127,7 +127,7 @@ struct Executor { | ||
// Case 1: Compatible, and invocable on the next function, giving | ||
// another function, that accepts BaseClass: | ||
struct Case1_; | ||
- using Case1 = std::conjunction<Compatible, curried, Case1_>; | ||
+ using Case1 = TypeList::conjunction<Compatible, curried, Case1_>; | ||
struct Case1_ { | ||
static constexpr bool value = std::is_invocable_v< | ||
std::invoke_result_t<F, Dummy &&>, BaseClass&, Args&&...>; | ||
@@ -135,7 +135,7 @@ struct Executor { | ||
}; | ||
|
||
// Case 2: Invocable directly on the object | ||
- struct Case2 : std::conjunction< | ||
+ struct Case2 : TypeList::conjunction< | ||
Compatible, std::negation<curried>, | ||
std::is_invocable<F, BaseClass&, Args&&...> | ||
> { |