summaryrefslogtreecommitdiff
path: root/lib/netdb.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/netdb.in.h')
-rw-r--r--lib/netdb.in.h48
1 files changed, 38 insertions, 10 deletions
diff --git a/lib/netdb.in.h b/lib/netdb.in.h
index 8d575c489c..028dfbed36 100644
--- a/lib/netdb.in.h
+++ b/lib/netdb.in.h
@@ -54,6 +54,10 @@
# 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
@@ -69,6 +73,11 @@ struct addrinfo
};
# define GNULIB_defined_struct_addrinfo 1
# endif
+
+# ifdef __cplusplus
+}
+# endif
+
# endif
/* Possible values for `ai_flags' field in `addrinfo' structure. */
@@ -155,19 +164,29 @@ struct addrinfo
socket addresses.
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
-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
<http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
-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 @REPLACE_GAI_STRERROR@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -191,12 +210,21 @@ _GL_CXXALIASWARN (gai_strerror);
/* Convert socket address to printable node and service names.
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/getnameinfo.html>. */
-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