1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

build: strict-aliasing on old compiler workaround

https://github.com/warmcat/libwebsockets/issues/1067
This commit is contained in:
Andy Green 2017-10-24 19:25:46 +08:00
parent 1c70181ca2
commit 4afeefbb3c

View file

@ -2265,7 +2265,11 @@ lws_socket_bind(struct lws_vhost *vhost, lws_sockfd_type sockfd, int port,
ntohs(((struct sockaddr_in6 *) &sin)->sin6_port) :
ntohs(((struct sockaddr_in *) &sin)->sin_port);
#else
port = ntohs(((struct sockaddr_in *) &sin)->sin_port);
{
struct sockaddr_in sain;
memcpy(&sain, &sin, sizeof(sain));
port = ntohs(sain.sin_port);
}
#endif
#endif