mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-23 09:59:42 +00:00
Fix "cast from 'struct sockaddr*' to 'struct sockaddr_in*' increases required alignment" on OS X
This commit is contained in:
parent
0aa2ebbbf3
commit
09f9d76631
@ -255,8 +255,10 @@ bool Socket::Connect(const char *addr, unsigned int port)
|
||||
}
|
||||
else
|
||||
{
|
||||
// sa.sin_addr.s_addr = ((in_addr *)(void *)lphost->h_addr)->s_addr;
|
||||
sa.sin_addr.s_addr = ((struct sockaddr_in *)(result->ai_addr))->sin_addr.s_addr;
|
||||
// Avoid assignment on due to alignment issues in Apple headers
|
||||
// sa.sin_addr.s_addr = ((struct sockaddr_in *)(result->ai_addr))->sin_addr.s_addr;
|
||||
struct sockaddr_in* sap = (struct sockaddr_in *)result->ai_addr;
|
||||
memcpy(&sa.sin_addr.s_addr, &sap->sin_addr.s_addr, sizeof(sa.sin_addr.s_addr));
|
||||
freeaddrinfo(result);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user