linux gcc compat

This commit is contained in:
Ryan Tharp 2018-07-24 01:06:56 +00:00
parent 03fff240cd
commit 49b4d0189a

View File

@ -269,7 +269,9 @@ raw_resolve_host(const char *url)
buffer[i + 2], buffer[i + 3]); buffer[i + 2], buffer[i + 3]);
struct sockaddr *g_addr = new sockaddr; struct sockaddr *g_addr = new sockaddr;
g_addr->sa_family = AF_INET; g_addr->sa_family = AF_INET;
#if ((__APPLE__ && __MACH__) || __FreeBSD__)
g_addr->sa_len = sizeof(in_addr); g_addr->sa_len = sizeof(in_addr);
#endif
struct in_addr *addr = &((struct sockaddr_in *)g_addr)->sin_addr; struct in_addr *addr = &((struct sockaddr_in *)g_addr)->sin_addr;
unsigned char *ip; unsigned char *ip;
@ -479,7 +481,9 @@ llarp_handle_dnsc_recvfrom(struct llarp_udp_io *udp,
if (answer->rdLen == 4) if (answer->rdLen == 4)
{ {
request->result.sa_family = AF_INET; request->result.sa_family = AF_INET;
#if ((__APPLE__ && __MACH__) || __FreeBSD__)
request->result.sa_len = sizeof(in_addr); request->result.sa_len = sizeof(in_addr);
#endif
struct in_addr *addr = struct in_addr *addr =
&((struct sockaddr_in *)&request->result)->sin_addr; &((struct sockaddr_in *)&request->result)->sin_addr;