summaryrefslogtreecommitdiff
path: root/lib/arpa_inet.in.h
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-04-23 08:02:48 +0200
committerSimon Josefsson <simon@josefsson.org>2008-04-23 08:02:48 +0200
commit49671ec97328d86dd90f5b8431be8351d8dee8c9 (patch)
tree3d3a0d9a1d592b50671e31c5417ca81a2289ca23 /lib/arpa_inet.in.h
parent88a40fa4f8a039aacbe54ce68e61ed1cdea6a0bf (diff)
downloadgnulib-49671ec97328d86dd90f5b8431be8351d8dee8c9.tar.gz
Add file, was missing from last commit.
Diffstat (limited to 'lib/arpa_inet.in.h')
-rw-r--r--lib/arpa_inet.in.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h
new file mode 100644
index 0000000000..f043e5951e
--- /dev/null
+++ b/lib/arpa_inet.in.h
@@ -0,0 +1,45 @@
+/* Provide a arpa/inet header file for systems lacking it (read: MinGW)
+ Copyright (C) 2008 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifndef _GL_ARPA_INET_H
+#define _GL_ARPA_INET_H
+
+/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
+ under MinGW. */
+#include <sys/socket.h>
+
+#if @GNULIB_INET_NTOP@
+# include <inet_ntop.h>
+#elif defined GNULIB_POSIXCHECK
+# undef inet_ntop
+# define inet_ntop(af,src,dst,cnt) \
+ (GL_LINK_WARNING ("inet_ntop doesn't exist on mingw - " \
+ "use gnulib module inet_ntop for portability"), \
+ inet_ntop (af, src, dst, cnt))
+#endif
+
+#if @GNULIB_INET_PTON@
+# include <inet_pton.h>
+#elif defined GNULIB_POSIXCHECK
+# undef inet_pton
+# define inet_pton(af,src,dst) \
+ (GL_LINK_WARNING ("inet_pton doesn't exist on mingw - " \
+ "use gnulib module inet_pton for portability"), \
+ inet_pton (af, src, dst))
+#endif
+
+#endif /* _GL_ARPA_INET_H */