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.h43
1 files changed, 25 insertions, 18 deletions
diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
index ac93399..f7c3bc7 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 Free Software Foundation, Inc. 3 Copyright (C) 2005-2006, 2008-2010 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
@@ -18,16 +18,19 @@
18 18
19#ifndef _GL_ARPA_INET_H 19#ifndef _GL_ARPA_INET_H
20 20
21#if __GNUC__ >= 3
22@PRAGMA_SYSTEM_HEADER@
23#endif
24
21/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc 25/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
22 under MinGW. */ 26 under MinGW.
23#include <sys/socket.h> 27 But avoid namespace pollution on glibc systems. */
28#ifndef __GLIBC__
29# include <sys/socket.h>
30#endif
24 31
25#if @HAVE_ARPA_INET_H@ 32#if @HAVE_ARPA_INET_H@
26 33
27# if __GNUC__ >= 3
28@PRAGMA_SYSTEM_HEADER@
29# endif
30
31/* The include_next requires a split double-inclusion guard. */ 34/* The include_next requires a split double-inclusion guard. */
32# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@ 35# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
33 36
@@ -36,7 +39,9 @@
36#ifndef _GL_ARPA_INET_H 39#ifndef _GL_ARPA_INET_H
37#define _GL_ARPA_INET_H 40#define _GL_ARPA_INET_H
38 41
39/* The definition of GL_LINK_WARNING is copied here. */ 42/* The definition of _GL_ARG_NONNULL is copied here. */
43
44/* The definition of _GL_WARN_ON_USE is copied here. */
40 45
41#ifdef __cplusplus 46#ifdef __cplusplus
42extern "C" { 47extern "C" {
@@ -60,26 +65,28 @@ extern "C" {
60 For more details, see the POSIX:2001 specification 65 For more details, see the POSIX:2001 specification
61 <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */ 66 <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
62extern const char *inet_ntop (int af, const void *restrict src, 67extern const char *inet_ntop (int af, const void *restrict src,
63 char *restrict dst, socklen_t cnt); 68 char *restrict dst, socklen_t cnt)
69 _GL_ARG_NONNULL ((2, 3));
64# endif 70# endif
65#elif defined GNULIB_POSIXCHECK 71#elif defined GNULIB_POSIXCHECK
66# undef inet_ntop 72# undef inet_ntop
67# define inet_ntop(af,src,dst,cnt) \ 73# if HAVE_RAW_DECL_INET_NTOP
68 (GL_LINK_WARNING ("inet_ntop is unportable - " \ 74_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
69 "use gnulib module inet_ntop for portability"), \ 75 "use gnulib module inet_ntop for portability");
70 inet_ntop (af, src, dst, cnt)) 76# endif
71#endif 77#endif
72 78
73#if @GNULIB_INET_PTON@ 79#if @GNULIB_INET_PTON@
74# if !@HAVE_DECL_INET_PTON@ 80# if !@HAVE_DECL_INET_PTON@
75extern int inet_pton (int af, const char *restrict src, void *restrict dst); 81extern int inet_pton (int af, const char *restrict src, void *restrict dst)
82 _GL_ARG_NONNULL ((2, 3));
76# endif 83# endif
77#elif defined GNULIB_POSIXCHECK 84#elif defined GNULIB_POSIXCHECK
78# undef inet_pton 85# undef inet_pton
79# define inet_pton(af,src,dst) \ 86# if HAVE_RAW_DECL_INET_PTON
80 (GL_LINK_WARNING ("inet_pton is unportable - " \ 87_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
81 "use gnulib module inet_pton for portability"), \ 88 "use gnulib module inet_pton for portability");
82 inet_pton (af, src, dst)) 89# endif
83#endif 90#endif
84 91
85#ifdef __cplusplus 92#ifdef __cplusplus