Commit 20338eab authored by Dominik Charousset's avatar Dominik Charousset

Fix build on GCC 8

parent ef16fe0d
......@@ -43,6 +43,13 @@ public:
return dref().bytes()[index];
}
// -- properties -------------------------------------------------------------
/// Returns the number of bytes of the address.
size_t size() const noexcept {
return dref().bytes().size();
}
// -- comparison -------------------------------------------------------------
/// Returns a negative number if `*this < other`, zero if `*this == other`
......
......@@ -136,7 +136,11 @@
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
# define CAF_POP_WARNINGS \
_Pragma("GCC diagnostic pop")
# define CAF_ANNOTATE_FALLTHROUGH static_cast<void>(0)
# if __GNUC__ >= 7
# define CAF_ANNOTATE_FALLTHROUGH __attribute__((fallthrough))
# else
# define CAF_ANNOTATE_FALLTHROUGH static_cast<void>(0)
# endif
# define CAF_COMPILER_VERSION \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
// disable thread_local on GCC/macOS due to heap-use-after-free bug:
......
......@@ -18,6 +18,7 @@
#pragma once
#include <algorithm>
#include <cstdint>
#include "caf/config.hpp"
......
......@@ -85,10 +85,6 @@ public:
return bytes_;
}
constexpr size_t size() const noexcept {
return bytes_.size();
}
// -- inspection -------------------------------------------------------------
template <class Inspector>
......
......@@ -100,11 +100,6 @@ public:
return bytes_;
}
/// Returns the number of bytes of an IPv6 address.
inline size_t size() const noexcept {
return bytes_.size();
}
/// Returns whether this address contains only zeros, i.e., equals `::`.
inline bool zero() const noexcept {
return half_segments_[0] == 0 && half_segments_[1] == 0;
......
......@@ -52,11 +52,11 @@ struct is_string_like {
decltype(x->size())
>::value
>::type* = nullptr,
// check if `x->compare(*x)` is well-formed and returns an integer
// check if `x->find('?', 0)` is well-formed and returns an integer
// (distinguishes vectors from strings)
typename std::enable_if<
std::is_integral<
decltype(x->compare(*x))
decltype(x->find('?', 0))
>::value
>::type* = nullptr);
......
......@@ -96,6 +96,7 @@ void uri_impl::add_encoded(string_view x, bool is_path) {
str += ch;
break;
}
// fall through
case ' ':
case ':':
case '?':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment