X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FProtocols%2FBSDSocketAddress.hh;h=ec3edfdf090513e43a38ad27739eb55d120b2536;hb=88f9350ae6a506cf453d15d3bd1ed38cb1baf2b3;hp=9fbc5f01a923430d2a38aab7c4b7fd76e04e65dc;hpb=00742c20f70026875a3561aeb9ba29eeb7274da9;p=senf.git diff --git a/Socket/Protocols/BSDSocketAddress.hh b/Socket/Protocols/BSDSocketAddress.hh index 9fbc5f0..ec3edfd 100644 --- a/Socket/Protocols/BSDSocketAddress.hh +++ b/Socket/Protocols/BSDSocketAddress.hh @@ -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::value> _; + boost::type_with_alignment::value> a_; + char _b[boost::alignment_of::value]; }; };