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