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

Fix build on GCC 8

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