aboutsummaryrefslogtreecommitdiffhomepage
path: root/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/unix.c b/unix.c
index b3cadd0..c36a082 100644
--- a/unix.c
+++ b/unix.c
@@ -102,6 +102,19 @@ enet_time_set (enet_uint32 newTimeBase)
}
int
+enet_address_set_host_ip (ENetAddress * address, const char * name)
+{
+#ifdef HAS_INET_PTON
+ if (! inet_pton (AF_INET, name, & address -> host))
+#else
+ if (! inet_aton (name, (struct in_addr *) & address -> host))
+#endif
+ return -1;
+
+ return 0;
+}
+
+int
enet_address_set_host (ENetAddress * address, const char * name)
{
#ifdef HAS_GETADDRINFO
@@ -153,14 +166,7 @@ enet_address_set_host (ENetAddress * address, const char * name)
}
#endif
-#ifdef HAS_INET_PTON
- if (! inet_pton (AF_INET, name, & address -> host))
-#else
- if (! inet_aton (name, (struct in_addr *) & address -> host))
-#endif
- return -1;
-
- return 0;
+ return enet_address_set_host_ip (address, name);
}
int