Skip to content

Commit

Permalink
fix for clang old version (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored May 17, 2023
1 parent 82200c5 commit 81a6812
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/struct_pack/struct_pack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ STRUCT_PACK_INLINE consteval std::uint32_t get_type_code() {
}

template <typename... Args>
STRUCT_PACK_INLINE consteval decltype(auto) get_type_literal() {
STRUCT_PACK_INLINE constexpr decltype(auto) get_type_literal() {
static_assert(sizeof...(Args) > 0);
if constexpr (sizeof...(Args) == 1) {
using Types = decltype(detail::get_types<Args...>());
Expand Down
6 changes: 5 additions & 1 deletion include/struct_pack/struct_pack/md5_constexpr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ template <typename Char, std::size_t Size1, std::size_t Size2>
constexpr bool operator!=(const string_literal<Char, Size1> &s1,
const string_literal<Char, Size2> &s2) {
if constexpr (Size1 == Size2) {
return !(s1 == s2);
for (int i = 0; i < Size1; ++i) {
if (s1[i] != s2[i])
return true;
}
return false;
}
else {
return true;
Expand Down
2 changes: 1 addition & 1 deletion include/struct_pack/struct_pack/struct_pack_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ constexpr inline type_info_config enable_type_info =
type_info_config::automatic;

template <typename... Args>
STRUCT_PACK_INLINE consteval decltype(auto) get_type_literal();
STRUCT_PACK_INLINE constexpr decltype(auto) get_type_literal();

struct serialize_buffer_size;

Expand Down

0 comments on commit 81a6812

Please sign in to comment.