summaryrefslogtreecommitdiff
path: root/lib/arpa_inet.in.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-12-26 23:56:33 +0100
committerBruno Haible <bruno@clisp.org>2010-12-27 01:30:14 +0100
commited4ce96d94a37ea75eb39d6a05b79f0b334cd2d0 (patch)
tree5f84281dce348bc2dc41dff009286ee48f979f3e /lib/arpa_inet.in.h
parent7ab8f04c34ed2b5429010a275a830a45d445ce8e (diff)
downloadgnulib-ed4ce96d94a37ea75eb39d6a05b79f0b334cd2d0.tar.gz
arpa_inet: Use the common idioms with C++ support.
* lib/arpa_inet.in.h: Include c++defs.h. (inet_ntop, inet_pton): Declare using the macros with C++ namespace support. * modules/arpa_inet (Depends-on): Add c++defs. (Makefile.am): Substitute the contents of c++defs.h. * modules/arpa_inet-tests (Depends-on): Add arpa_inet-c++-tests. * modules/arpa_inet-c++-tests: New file. * tests/test-arpa_inet-c++.cc: New file.
Diffstat (limited to 'lib/arpa_inet.in.h')
-rw-r--r--lib/arpa_inet.in.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h
index fbf084252f..cfbd977917 100644
--- a/lib/arpa_inet.in.h
+++ b/lib/arpa_inet.in.h
@@ -44,13 +44,12 @@
#ifndef _GL_ARPA_INET_H
#define _GL_ARPA_INET_H
+/* 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. */
-#ifdef __cplusplus
-extern "C" {
-#endif
#if @GNULIB_INET_NTOP@
# if !@HAVE_DECL_INET_NTOP@
@@ -69,10 +68,15 @@ extern "C" {
For more details, see the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
-extern const char *inet_ntop (int af, const void *restrict src,
- char *restrict dst, socklen_t cnt)
- _GL_ARG_NONNULL ((2, 3));
+_GL_FUNCDECL_SYS (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt)
+ _GL_ARG_NONNULL ((2, 3)));
# endif
+_GL_CXXALIAS_SYS (inet_ntop, const char *,
+ (int af, const void *restrict src,
+ char *restrict dst, socklen_t cnt));
+_GL_CXXALIASWARN (inet_ntop);
#elif defined GNULIB_POSIXCHECK
# undef inet_ntop
# if HAVE_RAW_DECL_INET_NTOP
@@ -83,9 +87,13 @@ _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
#if @GNULIB_INET_PTON@
# if !@HAVE_DECL_INET_PTON@
-extern int inet_pton (int af, const char *restrict src, void *restrict dst)
- _GL_ARG_NONNULL ((2, 3));
+_GL_FUNCDECL_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst)
+ _GL_ARG_NONNULL ((2, 3)));
# endif
+_GL_CXXALIAS_SYS (inet_pton, int,
+ (int af, const char *restrict src, void *restrict dst));
+_GL_CXXALIASWARN (inet_pton);
#elif defined GNULIB_POSIXCHECK
# undef inet_pton
# if HAVE_RAW_DECL_INET_PTON
@@ -94,9 +102,6 @@ _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
# endif
#endif
-#ifdef __cplusplus
-}
-#endif
#endif /* _GL_ARPA_INET_H */
#endif /* _GL_ARPA_INET_H */