mirror of
https://github.com/libretro/RetroArch
synced 2025-03-22 16:20:58 +00:00
Create inet_ptrton
This commit is contained in:
parent
c3676a07b1
commit
11ec23bc18
@ -136,14 +136,6 @@ struct hostent
|
||||
#ifdef GEKKO
|
||||
#define sendto(s, msg, len, flags, addr, tolen) net_sendto(s, msg, len, 0, addr, 8)
|
||||
#define socket(domain, type, protocol) net_socket(domain, type, protocol)
|
||||
|
||||
static INLINE int inet_pton(int af, const char *src, void *dst)
|
||||
{
|
||||
if (af != AF_INET)
|
||||
return -1;
|
||||
|
||||
return inet_aton (src, dst);
|
||||
}
|
||||
#endif
|
||||
|
||||
static INLINE bool isagain(int bytes)
|
||||
@ -213,6 +205,8 @@ struct addrinfo
|
||||
|
||||
uint16_t inet_htons(uint16_t hostshort);
|
||||
|
||||
int inet_ptrton(int af, const char *src, void *dst);
|
||||
|
||||
int getaddrinfo_retro(const char *node, const char *service,
|
||||
struct addrinfo *hints, struct addrinfo **res);
|
||||
|
||||
|
@ -326,3 +326,16 @@ uint16_t inet_htons(uint16_t hostshort)
|
||||
return htons(hostshort);
|
||||
#endif
|
||||
}
|
||||
|
||||
int inet_ptrton(int af, const char *src, void *dst)
|
||||
{
|
||||
/* TODO/FIXME - should use InetPton on Vista and later */
|
||||
#if defined(GEKKO) || defined(_WIN32)
|
||||
if (af != AF_INET)
|
||||
return -1;
|
||||
|
||||
return inet_aton(src, dst);
|
||||
#else
|
||||
return inet_pton(af, src, dst);
|
||||
#endif
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ void socket_set_target(void *data, socket_target_t *in_addr)
|
||||
out_target->sin_len = 8;
|
||||
#endif
|
||||
|
||||
inet_pton(AF_INET, in_addr->server, &out_target->sin_addr);
|
||||
inet_ptrton(AF_INET, in_addr->server, &out_target->sin_addr);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user