X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fnetdb.in.h;h=1de15469135168ca97f3501ecdcb5e05163f2f13;hb=4f6a7ef5f2097b501ddeac9db94d02306e4546d0;hp=e1bc2460cb4769a4e6a97a05187b664f8f452cb8;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/netdb.in.h b/lib/netdb.in.h index e1bc2460c..1de154691 100644 --- a/lib/netdb.in.h +++ b/lib/netdb.in.h @@ -20,7 +20,7 @@ It is intended to provide definitions and prototypes needed by an application. */ -#ifndef _GL_NETDB_H +#ifndef _@GUARD_PREFIX@_NETDB_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -34,12 +34,15 @@ #endif -#ifndef _GL_NETDB_H -#define _GL_NETDB_H +#ifndef _@GUARD_PREFIX@_NETDB_H +#define _@GUARD_PREFIX@_NETDB_H -/* Get netdb.h definitions such as struct hostent for MinGW. */ +/* Get definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and + 'struct hostent' on MinGW. */ #include +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + /* The definition of _GL_ARG_NONNULL is copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ @@ -51,6 +54,11 @@ # if !@HAVE_STRUCT_ADDRINFO@ +# ifdef __cplusplus +extern "C" { +# endif + +# if !GNULIB_defined_struct_addrinfo /* Structure to contain information about address of a service provider. */ struct addrinfo { @@ -63,6 +71,13 @@ struct addrinfo char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; +# define GNULIB_defined_struct_addrinfo 1 +# endif + +# ifdef __cplusplus +} +# endif + # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ @@ -149,37 +164,67 @@ struct addrinfo socket addresses. For more details, see the POSIX:2001 specification . */ -extern int getaddrinfo (const char *restrict nodename, - const char *restrict servname, - const struct addrinfo *restrict hints, - struct addrinfo **restrict res) - _GL_ARG_NONNULL ((4)); +_GL_FUNCDECL_SYS (getaddrinfo, int, + (const char *restrict nodename, + const char *restrict servname, + const struct addrinfo *restrict hints, + struct addrinfo **restrict res) + _GL_ARG_NONNULL ((4))); # endif +_GL_CXXALIAS_SYS (getaddrinfo, int, + (const char *restrict nodename, + const char *restrict servname, + const struct addrinfo *restrict hints, + struct addrinfo **restrict res)); +_GL_CXXALIASWARN (getaddrinfo); # if !@HAVE_DECL_FREEADDRINFO@ /* Free `addrinfo' structure AI including associated storage. For more details, see the POSIX:2001 specification . */ -extern void freeaddrinfo (struct addrinfo *ai) _GL_ARG_NONNULL ((1)); +_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai) + _GL_ARG_NONNULL ((1))); # endif +_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai)); +_GL_CXXALIASWARN (freeaddrinfo); -# if !@HAVE_DECL_GAI_STRERROR@ +# if @REPLACE_GAI_STRERROR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gai_strerror +# define gai_strerror rpl_gai_strerror +# endif +_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode)); +_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode)); +# else +# if !@HAVE_DECL_GAI_STRERROR@ /* Convert error return from getaddrinfo() to a string. For more details, see the POSIX:2001 specification . */ -extern const char *gai_strerror (int ecode); +_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode)); +# endif +_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode)); # endif +_GL_CXXALIASWARN (gai_strerror); # if !@HAVE_DECL_GETNAMEINFO@ /* Convert socket address to printable node and service names. For more details, see the POSIX:2001 specification . */ -extern int getnameinfo (const struct sockaddr *restrict sa, socklen_t salen, +_GL_FUNCDECL_SYS (getnameinfo, int, + (const struct sockaddr *restrict sa, socklen_t salen, + char *restrict node, socklen_t nodelen, + char *restrict service, socklen_t servicelen, + int flags) + _GL_ARG_NONNULL ((1))); +# endif +/* Need to cast, because on glibc systems, the seventh parameter is + unsigned int flags. */ +_GL_CXXALIAS_SYS_CAST (getnameinfo, int, + (const struct sockaddr *restrict sa, socklen_t salen, char *restrict node, socklen_t nodelen, char *restrict service, socklen_t servicelen, - int flags) - _GL_ARG_NONNULL ((1)); -# endif + int flags)); +_GL_CXXALIASWARN (getnameinfo); /* Possible flags for getnameinfo. */ # ifndef NI_NUMERICHOST @@ -217,5 +262,5 @@ _GL_WARN_ON_USE (getnameinfo, "getnameinfo is unportable - " #endif -#endif /* _GL_NETDB_H */ -#endif /* _GL_NETDB_H */ +#endif /* _@GUARD_PREFIX@_NETDB_H */ +#endif /* _@GUARD_PREFIX@_NETDB_H */