bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mingw pollution of DATADIR vs. configmake.h [was: [libvirt] [PATCH v


From: Bruno Haible
Subject: Re: mingw pollution of DATADIR vs. configmake.h [was: [libvirt] [PATCH v10 08/19] backup: Parse and output checkpoint XML]
Date: Tue, 30 Jul 2019 00:29:51 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-157-generic; KDE/5.18.0; x86_64; ; )

Hi Eric,

> unistd.in.h has:
> 
> /* Get all possible declarations of gethostname().  */
> #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
>   && !defined _GL_INCLUDING_WINSOCK2_H
> # define _GL_INCLUDING_WINSOCK2_H
> # include <winsock2.h>
> # undef _GL_INCLUDING_WINSOCK2_H
> #endif

When the application has requested the gnulib 'gethostname' module, it
means that the application wants to use a POSIX compatible gethostname()
function and not the original Windows gethostname().

Such an override logic does not apply for DATADIR. Asking for socket
functionality does not imply "I don't want to use the DATADIR macro",
and asking for the 'configmake' module does not imply "I want to hide
parts of the native Windows API". So, we cannot resolve the issue this way.

I can see two possible fixes:
  a) Change the 'configmake' module to define MAKEVAR_DATADIR instead of
     DATADIR.
  b) Document that "configmake.h" should be included after all the
     replacements of POSIX header files:
       #include <alloca.h>
       ...
       #include <wctype.h>
       #include "configmake.h"

And in fact, b) is already implemented since 2008! The module description says:

Include:
/* Include only after all system include files.  */
"configmake.h"

I'd suggest to add this recommendation also to doc/configmake.texi.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]