summaryrefslogtreecommitdiffstats
path: root/gl/arpa_inet.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/arpa_inet.in.h')
-rw-r--r--gl/arpa_inet.in.h89
1 files changed, 66 insertions, 23 deletions
diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
index f7c3bc72..ba89e977 100644
--- a/gl/arpa_inet.in.h
+++ b/gl/arpa_inet.in.h
@@ -1,6 +1,6 @@
1/* A GNU-like <arpa/inet.h>. 1/* A GNU-like <arpa/inet.h>.
2 2
3 Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc. 3 Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -13,22 +13,32 @@
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation, 16 along with this program; if not, see <http://www.gnu.org/licenses/>. */
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 17
19#ifndef _GL_ARPA_INET_H 18#ifndef _@GUARD_PREFIX@_ARPA_INET_H
20 19
21#if __GNUC__ >= 3 20#if __GNUC__ >= 3
22@PRAGMA_SYSTEM_HEADER@ 21@PRAGMA_SYSTEM_HEADER@
23#endif 22#endif
23@PRAGMA_COLUMNS@
24 24
25/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc 25#if @HAVE_FEATURES_H@
26 under MinGW. 26# include <features.h> /* for __GLIBC__ */
27#endif
28
29/* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and
30 for pulling in winsock2.h etc. under MinGW.
27 But avoid namespace pollution on glibc systems. */ 31 But avoid namespace pollution on glibc systems. */
28#ifndef __GLIBC__ 32#ifndef __GLIBC__
29# include <sys/socket.h> 33# include <sys/socket.h>
30#endif 34#endif
31 35
36/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
37 But avoid namespace pollution on glibc systems. */
38#if defined __TANDEM && !defined __GLIBC__
39# include <netdb.h>
40#endif
41
32#if @HAVE_ARPA_INET_H@ 42#if @HAVE_ARPA_INET_H@
33 43
34/* The include_next requires a split double-inclusion guard. */ 44/* The include_next requires a split double-inclusion guard. */
@@ -36,19 +46,17 @@
36 46
37#endif 47#endif
38 48
39#ifndef _GL_ARPA_INET_H 49#ifndef _@GUARD_PREFIX@_ARPA_INET_H
40#define _GL_ARPA_INET_H 50#define _@GUARD_PREFIX@_ARPA_INET_H
51
52/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
41 53
42/* The definition of _GL_ARG_NONNULL is copied here. */ 54/* The definition of _GL_ARG_NONNULL is copied here. */
43 55
44/* The definition of _GL_WARN_ON_USE is copied here. */ 56/* The definition of _GL_WARN_ON_USE is copied here. */
45 57
46#ifdef __cplusplus
47extern "C" {
48#endif
49 58
50#if @GNULIB_INET_NTOP@ 59#if @GNULIB_INET_NTOP@
51# if !@HAVE_DECL_INET_NTOP@
52/* Converts an internet address from internal format to a printable, 60/* Converts an internet address from internal format to a printable,
53 presentable format. 61 presentable format.
54 AF is an internet address family, such as AF_INET or AF_INET6. 62 AF is an internet address family, such as AF_INET or AF_INET6.
@@ -64,10 +72,32 @@ extern "C" {
64 72
65 For more details, see the POSIX:2001 specification 73 For more details, see the POSIX:2001 specification
66 <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */ 74 <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
67extern const char *inet_ntop (int af, const void *restrict src, 75# if @REPLACE_INET_NTOP@
68 char *restrict dst, socklen_t cnt) 76# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
69 _GL_ARG_NONNULL ((2, 3)); 77# undef inet_ntop
78# define inet_ntop rpl_inet_ntop
79# endif
80_GL_FUNCDECL_RPL (inet_ntop, const char *,
81 (int af, const void *restrict src,
82 char *restrict dst, socklen_t cnt)
83 _GL_ARG_NONNULL ((2, 3)));
84_GL_CXXALIAS_RPL (inet_ntop, const char *,
85 (int af, const void *restrict src,
86 char *restrict dst, socklen_t cnt));
87# else
88# if !@HAVE_DECL_INET_NTOP@
89_GL_FUNCDECL_SYS (inet_ntop, const char *,
90 (int af, const void *restrict src,
91 char *restrict dst, socklen_t cnt)
92 _GL_ARG_NONNULL ((2, 3)));
93# endif
94/* Need to cast, because on NonStop Kernel, the fourth parameter is
95 size_t cnt. */
96_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
97 (int af, const void *restrict src,
98 char *restrict dst, socklen_t cnt));
70# endif 99# endif
100_GL_CXXALIASWARN (inet_ntop);
71#elif defined GNULIB_POSIXCHECK 101#elif defined GNULIB_POSIXCHECK
72# undef inet_ntop 102# undef inet_ntop
73# if HAVE_RAW_DECL_INET_NTOP 103# if HAVE_RAW_DECL_INET_NTOP
@@ -77,10 +107,26 @@ _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
77#endif 107#endif
78 108
79#if @GNULIB_INET_PTON@ 109#if @GNULIB_INET_PTON@
80# if !@HAVE_DECL_INET_PTON@ 110# if @REPLACE_INET_PTON@
81extern int inet_pton (int af, const char *restrict src, void *restrict dst) 111# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
82 _GL_ARG_NONNULL ((2, 3)); 112# undef inet_pton
113# define inet_pton rpl_inet_pton
114# endif
115_GL_FUNCDECL_RPL (inet_pton, int,
116 (int af, const char *restrict src, void *restrict dst)
117 _GL_ARG_NONNULL ((2, 3)));
118_GL_CXXALIAS_RPL (inet_pton, int,
119 (int af, const char *restrict src, void *restrict dst));
120# else
121# if !@HAVE_DECL_INET_PTON@
122_GL_FUNCDECL_SYS (inet_pton, int,
123 (int af, const char *restrict src, void *restrict dst)
124 _GL_ARG_NONNULL ((2, 3)));
125# endif
126_GL_CXXALIAS_SYS (inet_pton, int,
127 (int af, const char *restrict src, void *restrict dst));
83# endif 128# endif
129_GL_CXXALIASWARN (inet_pton);
84#elif defined GNULIB_POSIXCHECK 130#elif defined GNULIB_POSIXCHECK
85# undef inet_pton 131# undef inet_pton
86# if HAVE_RAW_DECL_INET_PTON 132# if HAVE_RAW_DECL_INET_PTON
@@ -89,9 +135,6 @@ _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
89# endif 135# endif
90#endif 136#endif
91 137
92#ifdef __cplusplus
93}
94#endif
95 138
96#endif /* _GL_ARPA_INET_H */ 139#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
97#endif /* _GL_ARPA_INET_H */ 140#endif /* _@GUARD_PREFIX@_ARPA_INET_H */