mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
math/polymake: fix build with clang 19
PR: 283827 MFH: 2025Q1 Obtained from: https://forum.polymake.org/viewtopic.php?p=4159
This commit is contained in:
parent
4e78af111d
commit
b9a02d3009
14 changed files with 300 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
PORTNAME= polymake
|
||||
DISTVERSION= 4.13
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= math
|
||||
MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/V${DISTVERSION}/ \
|
||||
https://polymake.org/lib/exe/fetch.php/download/
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/bsgs.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/bsgs.h
|
||||
@@ -461,7 +461,7 @@ template <class PERM>
|
||||
* stabilizer chain are next to each other.
|
||||
*/
|
||||
template <class PERM>
|
||||
-class StrongGeneratingSetSorter : public std::binary_function<typename PERM::ptr, typename PERM::ptr, bool> {
|
||||
+class StrongGeneratingSetSorter {
|
||||
public:
|
||||
/**
|
||||
* @param baseBegin begin-iterator(dom_int) to the base relative to which the strong generating set is to be sorted
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/predicate/identity_predicate.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/predicate/identity_predicate.h
|
||||
@@ -39,7 +39,7 @@ template <class PERM>
|
||||
|
||||
/// predicate matching a permutation if it stabilizes a given list of points pointwise
|
||||
template <class PERM>
|
||||
-class IdentityPredicate : public std::unary_function<typename PERM::ptr, bool> {
|
||||
+class IdentityPredicate {
|
||||
public:
|
||||
/// evaluate predicate
|
||||
bool operator()(const typename PERM::ptr &p) const {
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/predicate/pointwise_stabilizer_predicate.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/predicate/pointwise_stabilizer_predicate.h
|
||||
@@ -39,7 +39,7 @@ template <class PERM>
|
||||
|
||||
/// predicate matching a permutation if it stabilizes a given list of points pointwise
|
||||
template <class PERM>
|
||||
-class PointwiseStabilizerPredicate : public std::unary_function<typename PERM::ptr, bool> {
|
||||
+class PointwiseStabilizerPredicate {
|
||||
public:
|
||||
/// constructor
|
||||
/**
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/predicate/stabilizes_point_predicate.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/predicate/stabilizes_point_predicate.h
|
||||
@@ -39,7 +39,7 @@ template <class PERM>
|
||||
|
||||
/// predicate matching points that are stabilized by given permutations
|
||||
template <class PERM>
|
||||
-class StabilizesPointPredicate : public std::unary_function<unsigned long, bool> {
|
||||
+class StabilizesPointPredicate {
|
||||
public:
|
||||
/// constructor
|
||||
/**
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/predicate/subgroup_predicate.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/predicate/subgroup_predicate.h
|
||||
@@ -42,7 +42,7 @@ template <class PERM>
|
||||
|
||||
/// abstract base class for subgroup (and coset) predicates
|
||||
template <class PERM>
|
||||
-class SubgroupPredicate : public std::unary_function<PERM, bool> {
|
||||
+class SubgroupPredicate {
|
||||
public:
|
||||
/// virtual destructor
|
||||
virtual ~SubgroupPredicate() {}
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/search/partition/backtrack_refinement.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/search/partition/backtrack_refinement.h
|
||||
@@ -67,7 +67,7 @@ class BacktrackRefinement : public Refinement<PERM> {
|
||||
|
||||
typedef typename Refinement<PERM>::RefinementPtr RefinementPtr;
|
||||
|
||||
- struct RefinementSorter : public std::binary_function<RefinementPtr, RefinementPtr, bool> {
|
||||
+ struct RefinementSorter {
|
||||
RefinementSorter(const BaseSorterByReference& sorter, const Partition* pi) : m_sorter(sorter), m_pi(pi) {}
|
||||
|
||||
bool operator()(RefinementPtr a, RefinementPtr b) const {
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/sorter/base_sorter.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/sorter/base_sorter.h
|
||||
@@ -39,7 +39,7 @@ template<class ORDER>
|
||||
|
||||
/// A sorter that sorts a sequence with respect to a given input ordering
|
||||
template<class ORDER>
|
||||
-class OrderedSorter : public std::binary_function<unsigned long, unsigned long, bool> {
|
||||
+class OrderedSorter {
|
||||
public:
|
||||
/// true iff a preceeds b in given sequence
|
||||
bool operator() (unsigned long a, unsigned long b) const {
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/sorter/group_sorter.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/sorter/group_sorter.h
|
||||
@@ -39,7 +39,7 @@ template <class PERM>
|
||||
|
||||
/// A sorter that sorts a sequence of permutations with respect to a ordering induced by a base
|
||||
template <class PERM>
|
||||
-class GroupSorter : public std::binary_function<PERM, PERM, bool>{
|
||||
+class GroupSorter {
|
||||
public:
|
||||
/// constructor
|
||||
/**
|
|
@ -0,0 +1,11 @@
|
|||
--- external/permlib/include/permlib/sorter/trivial_sorter.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ external/permlib/include/permlib/sorter/trivial_sorter.h
|
||||
@@ -36,7 +36,7 @@ namespace permlib {
|
||||
namespace permlib {
|
||||
|
||||
/// A sorter that sorts a sequence in natural numerical order (1 < 2 < 3 < ...)
|
||||
-class TrivialSorter : public std::binary_function<unsigned long, unsigned long, bool>{
|
||||
+class TrivialSorter {
|
||||
public:
|
||||
/// true iff a < b
|
||||
bool operator() (unsigned long a, unsigned long b) const {
|
131
math/polymake/files/patch-lib_core_include_ContainerChain.h
Normal file
131
math/polymake/files/patch-lib_core_include_ContainerChain.h
Normal file
|
@ -0,0 +1,131 @@
|
|||
--- lib/core/include/ContainerChain.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ lib/core/include/ContainerChain.h
|
||||
@@ -1128,15 +1128,15 @@ class modified_container_tuple_impl (public)
|
||||
|
||||
Int size() const
|
||||
{
|
||||
- return this->manip_top().template get_container(size_constant<base_t::normal_it_pos>()).size();
|
||||
+ return this->manip_top().get_container(size_constant<base_t::normal_it_pos>()).size();
|
||||
}
|
||||
Int dim() const
|
||||
{
|
||||
- return get_dim(this->manip_top().template get_container(size_constant<base_t::normal_it_pos>()));
|
||||
+ return get_dim(this->manip_top().get_container(size_constant<base_t::normal_it_pos>()));
|
||||
}
|
||||
bool empty() const
|
||||
{
|
||||
- return this->manip_top().template get_container(size_constant<base_t::normal_it_pos>()).empty();
|
||||
+ return this->manip_top().get_container(size_constant<base_t::normal_it_pos>()).empty();
|
||||
}
|
||||
|
||||
decltype(auto) front()
|
||||
@@ -1153,40 +1153,40 @@ class modified_container_tuple_impl (public)
|
||||
iterator make_begin(std::index_sequence<Index...>, mlist<Features...>)
|
||||
{
|
||||
return iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).begin()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).begin()...);
|
||||
}
|
||||
|
||||
template <size_t... Index, typename... Features>
|
||||
iterator make_end(std::index_sequence<Index...>, mlist<Features...>)
|
||||
{
|
||||
return iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).end()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).end()...);
|
||||
}
|
||||
|
||||
template <size_t... Index, typename... Features>
|
||||
const_iterator make_begin(std::index_sequence<Index...>, mlist<Features...>) const
|
||||
{
|
||||
return const_iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).begin()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).begin()...);
|
||||
}
|
||||
|
||||
template <size_t... Index, typename... Features>
|
||||
const_iterator make_end(std::index_sequence<Index...>, mlist<Features...>) const
|
||||
{
|
||||
return const_iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).end()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).end()...);
|
||||
}
|
||||
|
||||
template <size_t... Index>
|
||||
decltype(auto) make_front(std::index_sequence<Index...>)
|
||||
{
|
||||
- return this->manip_top().get_operation()( this->manip_top().template get_container(size_constant<Index>()).front()... );
|
||||
+ return this->manip_top().get_operation()( this->manip_top().get_container(size_constant<Index>()).front()... );
|
||||
}
|
||||
|
||||
template <size_t... Index>
|
||||
decltype(auto) make_front(std::index_sequence<Index...>) const
|
||||
{
|
||||
- return this->manip_top().get_operation()( this->manip_top().template get_container(size_constant<Index>()).front()... );
|
||||
+ return this->manip_top().get_operation()( this->manip_top().get_container(size_constant<Index>()).front()... );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1230,40 +1230,40 @@ class modified_container_tuple_impl<Top, Params, std::
|
||||
reverse_iterator make_rbegin(std::index_sequence<Index...>, mlist<Features...>)
|
||||
{
|
||||
return reverse_iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).rbegin()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).rbegin()...);
|
||||
}
|
||||
|
||||
template <size_t... Index, typename... Features>
|
||||
reverse_iterator make_rend(std::index_sequence<Index...>, mlist<Features...>)
|
||||
{
|
||||
return reverse_iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).rend()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).rend()...);
|
||||
}
|
||||
|
||||
template <size_t... Index, typename... Features>
|
||||
const_reverse_iterator make_rbegin(std::index_sequence<Index...>, mlist<Features...>) const
|
||||
{
|
||||
return const_reverse_iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).rbegin()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).rbegin()...);
|
||||
}
|
||||
|
||||
template <size_t... Index, typename... Features>
|
||||
const_reverse_iterator make_rend(std::index_sequence<Index...>, mlist<Features...>) const
|
||||
{
|
||||
return const_reverse_iterator(this->manip_top().get_operation(),
|
||||
- ensure(this->manip_top().template get_container(size_constant<Index>()), muntag_t<Features>()).rend()...);
|
||||
+ ensure(this->manip_top().get_container(size_constant<Index>()), muntag_t<Features>()).rend()...);
|
||||
}
|
||||
|
||||
template <size_t... Index>
|
||||
decltype(auto) make_back(std::index_sequence<Index...>)
|
||||
{
|
||||
- return this->manip_top().get_operation()( this->manip_top().template get_container(size_constant<Index>()).back()... );
|
||||
+ return this->manip_top().get_operation()( this->manip_top().get_container(size_constant<Index>()).back()... );
|
||||
}
|
||||
|
||||
template <size_t... Index>
|
||||
decltype(auto) make_back(std::index_sequence<Index...>) const
|
||||
{
|
||||
- return this->manip_top().get_operation()( this->manip_top().template get_container(size_constant<Index>()).back()... );
|
||||
+ return this->manip_top().get_operation()( this->manip_top().get_container(size_constant<Index>()).back()... );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1285,13 +1285,13 @@ class modified_container_tuple_impl<Top, Params, std::
|
||||
template <size_t... Index>
|
||||
decltype(auto) make_random(Int i, std::index_sequence<Index...>)
|
||||
{
|
||||
- return this->manip_top().get_operation()( this->manip_top().template get_container(size_constant<Index>())[i]... );
|
||||
+ return this->manip_top().get_operation()( this->manip_top().get_container(size_constant<Index>())[i]... );
|
||||
}
|
||||
|
||||
template <size_t... Index>
|
||||
decltype(auto) make_random(Int i, std::index_sequence<Index...>) const
|
||||
{
|
||||
- return this->manip_top().get_operation()( this->manip_top().template get_container(size_constant<Index>())[i]... );
|
||||
+ return this->manip_top().get_operation()( this->manip_top().get_container(size_constant<Index>())[i]... );
|
||||
}
|
||||
};
|
||||
|
17
math/polymake/files/patch-lib_core_include_GenericMatrix.h
Normal file
17
math/polymake/files/patch-lib_core_include_GenericMatrix.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
--- lib/core/include/GenericMatrix.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ lib/core/include/GenericMatrix.h
|
||||
@@ -1525,12 +1525,12 @@ class ConcatRows< BlockMatrix<MatrixList, std::true_ty
|
||||
template <size_t i>
|
||||
decltype(auto) get_container(size_constant<i>)
|
||||
{
|
||||
- return concat_rows(this->hidden().template get_container(size_constant<i>()));
|
||||
+ return concat_rows(this->hidden().get_container(size_constant<i>()));
|
||||
}
|
||||
template <size_t i>
|
||||
decltype(auto) get_container(size_constant<i>) const
|
||||
{
|
||||
- return concat_rows(this->hidden().template get_container(size_constant<i>()));
|
||||
+ return concat_rows(this->hidden().get_container(size_constant<i>()));
|
||||
}
|
||||
|
||||
ConcatRows& operator= (const ConcatRows& other) { return ConcatRows::generic_type::operator=(other); }
|
|
@ -0,0 +1,14 @@
|
|||
--- lib/core/include/internal/pool_allocator.h.orig 2024-09-24 09:32:47 UTC
|
||||
+++ lib/core/include/internal/pool_allocator.h
|
||||
@@ -34,7 +34,11 @@ class allocator : public PM_ALLOCATOR_BASE<char> { (pu
|
||||
public:
|
||||
void* allocate(std::size_t n)
|
||||
{
|
||||
+#if __cplusplus < 201703L
|
||||
return base_t::allocate(n, nullptr);
|
||||
+#else
|
||||
+ return base_t::allocate(n);
|
||||
+#endif
|
||||
}
|
||||
void deallocate(void* p, std::size_t n)
|
||||
{
|
38
math/polymake/files/patch-lib_core_include_optional
Normal file
38
math/polymake/files/patch-lib_core_include_optional
Normal file
|
@ -0,0 +1,38 @@
|
|||
--- lib/core/include/optional.orig 2024-09-24 09:32:47 UTC
|
||||
+++ lib/core/include/optional
|
||||
@@ -7,6 +7,8 @@
|
||||
// Moreover, older clangs produce strange errors even in combination with libstdc++.
|
||||
// For this configuration, we include a minimal implementation just covering our needs.
|
||||
|
||||
+#if __cplusplus < 201703L
|
||||
+
|
||||
#if defined(__clang__) && (defined(_LIBCPP_STD_VER) || __clang_major__ < 4)
|
||||
|
||||
#include "polymake/internal/type_union.h"
|
||||
@@ -76,8 +78,6 @@ using pm::make_optional;
|
||||
|
||||
#else // GCC or clang >= 4
|
||||
|
||||
-#if __cplusplus < 201703L
|
||||
-
|
||||
# include <experimental/optional>
|
||||
|
||||
namespace polymake {
|
||||
@@ -91,6 +91,8 @@ using std::experimental::make_optional;
|
||||
using std::experimental::make_optional;
|
||||
}
|
||||
|
||||
+#endif
|
||||
+
|
||||
#else
|
||||
|
||||
#include <optional>
|
||||
@@ -105,8 +107,6 @@ using std::make_optional;
|
||||
using std::nullopt;
|
||||
using std::make_optional;
|
||||
}
|
||||
-
|
||||
-#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Reference in a new issue