From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 69CF01F731 for ; Thu, 8 Aug 2019 12:06:21 +0000 (UTC) Received: from localhost ([::1]:49430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvhBU-0003M7-61 for normalperson@yhbt.net; Thu, 08 Aug 2019 08:06:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51385) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvhAM-0003GN-3F for bug-gnulib@gnu.org; Thu, 08 Aug 2019 08:05:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvhAD-0006Ky-JC for bug-gnulib@gnu.org; Thu, 08 Aug 2019 08:05:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52778) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hvhAC-0005lC-B8 for bug-gnulib@gnu.org; Thu, 08 Aug 2019 08:05:00 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB63AC0546FC for ; Thu, 8 Aug 2019 12:04:24 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-93.phx2.redhat.com [10.3.116.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 918F61000337 for ; Thu, 8 Aug 2019 12:04:24 +0000 (UTC) From: Eric Blake To: bug-gnulib@gnu.org Subject: [PATCH] configmake: Avoid namespace pollution issue on mingw. Date: Thu, 8 Aug 2019 07:04:24 -0500 Message-Id: <20190808120424.2750-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 08 Aug 2019 12:04:24 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Mingw includes a header that declares a struct typedef named DATADIR, pulled in when including ; compilation fails if DATADIR has already been defined as a macro expanding to a string prior to that inclusion. Although the configmake module documents that it should generally be included only after system headers, it is just as easy to make configmake.h robust to this particular issue by including the system header first if it exists. * modules/configmake (Makefile.am): If the project uses , include that header before defining DATADIR. Reported by libvirt: https://lists.gnu.org/archive/html/bug-gnulib/2019-0= 7/msg00089.html --- I've tested that this will fix the issue originally reported by libvirt. Bruno's suggestion of renaming configmake.h's version to something like MAKEVAR_DATADIR would also work, but if we did that, it would be better to uniformly rename all of configmake.h's macros (and that is much more invasive to the existing users of configmake). ChangeLog | 6 ++++++ modules/configmake | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 644330370..35f870abe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-08-08 Eric Blake + + configmake: Avoid namespace pollution issue on mingw. + * modules/configmake (Makefile.am): If the project uses + , include that header before defining DATADIR. + 2019-07-28 Bruno Haible mbrtowc tests: Fix regression on mingw (regression from 2018-02-24). diff --git a/modules/configmake b/modules/configmake index 5a60f4f80..0074071fc 100644 --- a/modules/configmake +++ b/modules/configmake @@ -17,6 +17,9 @@ Makefile.am: configmake.h: Makefile $(AM_V_GEN)rm -f $@-t && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#if HAVE_WINSOCK2_H'; \ + echo '# include /* avoid mingw pollution on DATAD= IR */'; \ + echo '#endif'; \ echo '#define PREFIX "$(prefix)"'; \ echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ echo '#define BINDIR "$(bindir)"'; \ --=20 2.20.1