summaryrefslogtreecommitdiff
path: root/m4/getdomainname.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-07-22 00:16:46 +0200
committerBruno Haible <bruno@clisp.org>2011-07-22 00:16:46 +0200
commit6195fa324fac1442ba68395a30f32110997959dd (patch)
treee397f6be87b4b82343c3cbdbae3ebfc9d13aeabb /m4/getdomainname.m4
parent5833dfd948db783dcfd90e1273104b778e2ec773 (diff)
downloadgnulib-6195fa324fac1442ba68395a30f32110997959dd.tar.gz
Declare system functions in a way that works with C++.
* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR) [C++]: In the test program, declare fdopendir as extern "C". * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS) [C++]: In the test program, declare frexpl as extern "C". * m4/getaddrinfo.m4 (gl_GETADDRINFO) [C++]: In the test program, declare gai_strerror as extern "C". * m4/getdomainname.m4 (gl_FUNC_GETDOMAINNAME) [C++]: In the test programs, declare gai_strerror as extern "C". * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R) [C++]: In the test program, declare getlogin_r as extern "C". * m4/ioctl.m4 (gl_FUNC_IOCTL) [C++]: In the test program, declare ioctl as extern "C". * m4/ldexpl.m4 (gl_FUNC_LDEXPL_WORKS) [C++]: In the test program, declare ldexpl as extern "C". * m4/logb.m4 (gl_FUNC_LOGB) [C++]: In the test programs, declare logb as extern "C". * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS) [C++]: In the test program, declare getmntinfo as extern "C". * m4/stpncpy.m4 (gl_FUNC_STPNCPY) [C++]: In the test program, declare stpncpy as extern "C". * m4/strerror_r.m4 (gl_FUNC_STRERROR_R_WORKS) [C++]: In the test program, declare __xpg_strerror_r as extern "C". * m4/strndup.m4 (gl_FUNC_STRNDUP) [C++]: In the test program, declare strndup as extern "C". * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT) [C++]: In the test program, declare memset and bzero as extern "C". Reported by Sam Steingold <sds@gnu.org>.
Diffstat (limited to 'm4/getdomainname.m4')
-rw-r--r--m4/getdomainname.m415
1 files changed, 12 insertions, 3 deletions
diff --git a/m4/getdomainname.m4 b/m4/getdomainname.m4
index 9e93fc93cd..542e4cead4 100644
--- a/m4/getdomainname.m4
+++ b/m4/getdomainname.m4
@@ -1,4 +1,4 @@
-# getdomainname.m4 serial 7
+# getdomainname.m4 serial 8
dnl Copyright (C) 2002-2003, 2008-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,11 @@ AC_DEFUN([gl_FUNC_GETDOMAINNAME],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stddef.h>
- extern int getdomainname (char *, size_t);
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int getdomainname (char *, size_t);
]],
[[getdomainname(NULL, 0);]])],
[gl_cv_func_getdomainname_in_libnsl=yes])
@@ -63,7 +67,12 @@ AC_DEFUN([gl_FUNC_GETDOMAINNAME],
#include <netdb.h>
#endif
#include <unistd.h>
- extern int getdomainname (char *, int);]],
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int getdomainname (char *, int);
+ ]],
[[]])],
[gl_cv_decl_getdomainname_argtype2='int'],
[gl_cv_decl_getdomainname_argtype2='size_t'])