Skip to content

Commit 31ee15c

Browse files
authored
Merge pull request #92 from SGSSGene/fix/int128
fix: add gcc __int128 handling
2 parents 7ed8c3a + 0b2cd67 commit 31ee15c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/fmindex-collection/std/chunk_view.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define SEQAN_STD_CHUNK_VIEW
1313

1414
#include <cassert>
15+
#include <cstdint>
1516
#include <ranges>
1617

1718
#ifdef __cpp_lib_ranges_chunk
@@ -66,6 +67,18 @@ constexpr auto to_unsigned_like(std::_Unsigned128 v) noexcept
6667
}
6768
#endif
6869

70+
//!WORKAROUND GCC/Clang
71+
// GCC uses __int128 as range type
72+
#if defined(__GNUC__)
73+
// required for GCC using __int128 in some cases
74+
template <typename T>
75+
requires (!std::integral<T> && std::convertible_to<T, uint64_t>)
76+
constexpr auto to_unsigned_like(T v) noexcept
77+
{
78+
return static_cast<uint64_t>(v);
79+
}
80+
#endif
81+
6982

7083
} // namespace seqan::stl::detail::chunk
7184

0 commit comments

Comments
 (0)