]> Savannah Git Hosting - gnulib.git/commitdiff
Avoid false gethostname_used_without_requesting_gnulib_module_gethostname.
authorBruno Haible <bruno@clisp.org>
Wed, 24 Jul 2024 21:53:53 +0000 (23:53 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 16:00:46 +0000 (18:00 +0200)
* modules/gethostname (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/unistd.in.h (gethostname): Don't define to
gethostname_used_without_requesting_gnulib_module_gethostname if the
gnulib module 'gethostname' is in use under the same configure.ac.

ChangeLog
lib/unistd.in.h
modules/gethostname

index eba06aa9e2d4dc52fdfd3ea63a08342b3653dd65..db387774f59635d6ac2abd4eedfcb7b0020c2fad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2024-07-24  Bruno Haible  <bruno@clisp.org>
 
+       Avoid false gethostname_used_without_requesting_gnulib_module_gethostname.
+       * modules/gethostname (configure.ac): Invoke gl_MODULE_INDICATOR.
+       * lib/unistd.in.h (gethostname): Don't define to
+       gethostname_used_without_requesting_gnulib_module_gethostname if the
+       gnulib module 'gethostname' is in use under the same configure.ac.
+
        Avoid false error close_used_without_requesting_gnulib_module_close.
        Reported by Frédéric at <https://savannah.gnu.org/bugs/?65958>.
        * modules/close (configure.ac): Invoke gl_MODULE_INDICATOR.
index 688988e9e2163b8ae3d4e491b6a32a17e8482269..9ca377c4dfb432ec82abcd863aef725e673bfc47 100644 (file)
@@ -1318,8 +1318,10 @@ _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
 # endif
 _GL_CXXALIASWARN (gethostname);
 #elif @UNISTD_H_HAVE_WINSOCK2_H@
-# undef gethostname
-# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
+# if !GNULIB_GETHOSTNAME
+#  undef gethostname
+#  define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef gethostname
 # if HAVE_RAW_DECL_GETHOSTNAME
index 94151cd8b0c8bb5f47ac3aa21c85f1527fa79df5..8523a8e9447c9281f6d643166dec0130e125ad74 100644 (file)
@@ -20,6 +20,7 @@ AM_COND_IF([GL_COND_OBJ_GETHOSTNAME], [
   gl_PREREQ_GETHOSTNAME
 ])
 gl_UNISTD_MODULE_INDICATOR([gethostname])
+gl_MODULE_INDICATOR([gethostname])
 
 Makefile.am:
 if GL_COND_OBJ_GETHOSTNAME