summaryrefslogtreecommitdiff
path: root/lib/system.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-07-28 15:00:25 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-07-28 15:15:32 +0200
commitd11334a55e2f91e5f14391ed46bc4adfad6894e1 (patch)
treee1668a468b085772fed5c0369f879790771563c9 /lib/system.h
parent317078fd588606a06a6b9eb79caf7d1fa492d754 (diff)
downloadgnutls-d11334a55e2f91e5f14391ed46bc4adfad6894e1.tar.gz
Added replacements of inet_aton and inet_pton on systems they are not present
gnulib is avoided due to keep the gnulib network replacements out of the library.
Diffstat (limited to 'lib/system.h')
-rw-r--r--lib/system.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/system.h b/lib/system.h
index d2e695a40c..0e7bcfbcc8 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -98,4 +98,15 @@ int _gnutls_ucs2_to_utf8(const void *data, size_t size,
int gnutls_system_global_init(void);
void gnutls_system_global_deinit(void);
+#include <arpa/inet.h>
+#ifdef _WIN32
+# define inet_aton _gnutls_inet_aton
+int inet_aton(const char *cp, struct in_addr *inp);
+#endif
+
+#ifndef HAVE_INET_PTON
+# define inet_pton _gnutls_inet_pton
+int inet_pton(int af, const char *src, void *dst);
+#endif
+
#endif /* SYSTEM_H */