Skip to content
Snippets Groups Projects
Commit 4da8dd90 authored by g0dil's avatar g0dil
Browse files

Socket/Protocols: Really fix 64bit alignment issue

parent 42c14ca5
No related branches found
No related tags found
No related merge requests found
......@@ -114,10 +114,15 @@ namespace senf {
void socklen(socklen_t len);
private:
// The following incantation is needed to fix the alignment of the sockaddr data members
// which will be added by the derived classes later: The alignment must be forced
// to coincide with the struct sockaddr_storage alignment (which must have the largest
// alignment of all sockaddr types).
union {
socklen_t len_;
boost::type_with_alignment<boost::alignment_of<struct sockaddr_storage>::value> _;
boost::type_with_alignment<boost::alignment_of<struct sockaddr_storage>::value> a_;
char _b[boost::alignment_of<struct sockaddr_storage>::value];
};
};
......
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