Skip to content
Snippets Groups Projects
Verified Commit 2d0ae056 authored by Benny Baumann's avatar Benny Baumann
Browse files

fix: Workaround for compile issue with -Weffc++

parent c1045578
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
#include <functional>
#include "macros.hpp"
#include "net/netio_exception.hpp"
#ifdef __linux__
......@@ -80,17 +81,24 @@ public:
}
template <typename T>
socketaddr &operator=(T *rhs) {
socketaddr& operator=(const T *rhs) {
if (rhs->*(family_map<T>::sa_family_field) != family_map<T>::sa_family) {
throw netio_exception("Address family mismatch in sockaddr structure.");
}
memcpy(&addr, rhs, sizeof(T));
len = sizeof(T);
COMPILER_SUPRESS("-Weffc++");
return *this;
COMPILER_RESTORE("-Weffc++");
}
socketaddr &operator=(sockaddr_storage *rhs) {
return *this = (sockaddr*)rhs;
socketaddr& operator=(const sockaddr_storage *rhs) {
*this = (sockaddr*)rhs;
COMPILER_SUPRESS("-Weffc++");
return *this;
COMPILER_RESTORE("-Weffc++");
}
socketaddr& operator=(sockaddr *rhs) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment