tests: avoid spurious assertion failure in test-float.c on ppc64
[gnulib.git] / m4 / getdomainname.m4
index db7d480..542e4ce 100644 (file)
@@ -1,4 +1,4 @@
-# getdomainname.m4 serial 6
+# 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'])
@@ -82,11 +91,6 @@ AC_DEFUN([gl_FUNC_GETDOMAINNAME],
      || test "$gl_cv_func_getdomainname_in_libnsl" = yes; then
     REPLACE_GETDOMAINNAME=1
   fi
-
-  if test $HAVE_DECL_GETDOMAINNAME = 0 || test $REPLACE_GETDOMAINNAME = 1; then
-    AC_LIBOBJ([getdomainname])
-    gl_PREREQ_GETDOMAINNAME
-  fi
 ])
 
 # Prerequisites of lib/getdomainname.c.