From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: Emacs build fails on Windows mingw64 Date: Sun, 24 Oct 2021 08:25:29 -0400 Message-ID: <867fb020-c32b-3a42-1910-385756846c6d@cs.ucla.edu> References: <86v91nfp6e.fsf@gmail.com> <0b467abe-dd50-6a0a-7d1f-37eb990900be@cs.ucla.edu> <83ee8b3pme.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------6E1856DBE619050D3712ED54" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14107"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Cc: bug-gnulib@gnu.org, andrewjmoreton@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Sun Oct 24 14:25:49 2021 Return-path: Envelope-to: gnu-bug-gnulib@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mecZQ-0003Ov-R0 for gnu-bug-gnulib@m.gmane-mx.org; Sun, 24 Oct 2021 14:25:48 +0200 Original-Received: from localhost ([::1]:55092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mecZO-0003Su-Vm for gnu-bug-gnulib@m.gmane-mx.org; Sun, 24 Oct 2021 08:25:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mecZM-0003Sa-1m; Sun, 24 Oct 2021 08:25:44 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mecZH-0006zs-Ob; Sun, 24 Oct 2021 08:25:43 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EE53716008C; Sun, 24 Oct 2021 05:25:35 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id BRb11aAfFxoS; Sun, 24 Oct 2021 05:25:34 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C67271600AE; Sun, 24 Oct 2021 05:25:34 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TKDqMj-mzDdK; Sun, 24 Oct 2021 05:25:34 -0700 (PDT) Original-Received: from [172.24.197.33] (aca-104109.nat.emory.edu [170.140.104.109]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 5177616008C; Sun, 24 Oct 2021 05:25:34 -0700 (PDT) In-Reply-To: <83ee8b3pme.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -74 X-Spam_score: -7.5 X-Spam_bar: ------- X-Spam_report: (-7.5 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-3.33, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnulib" Xref: news.gmane.io gmane.comp.lib.gnulib.bugs:45176 gmane.emacs.devel:277649 Archived-At: This is a multi-part message in MIME format. --------------6E1856DBE619050D3712ED54 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 10/24/21 2:26 AM, Eli Zaretskii wrote: > Let me turn the table and ask why that declaration of strdup is at all > needed in Gnulib's string.h when it's used in MinGW builds? It's so that apps can be checked better statically. For example, the=20 contrived code: =C2=A0=C2=A0 return strcmp (x, strdup (x)); getts a diagnostic about a memory leak. This can be helpful regardless=20 of whether Gnulib's strdup substitute code is used. The Gnulib wrapper here is merely mimicking what glibc does; it's not a=20 Gnulib invention. > ntlib cannot include config.h, > due to various redefinitions and redirections we do in ms-w32.h for > Emacs. I now see Emacs has a symbol DEFER_MS_W3_H to deal with this glitch. So=20 how about the attached patch instead? If it doesn't suffice, presumably=20 something like DEFER_MS_W3_H would suffice. --------------6E1856DBE619050D3712ED54 Content-Type: text/x-patch; charset=UTF-8; name="0001-Include-config.h-first-in-MS-Windows-source.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Include-config.h-first-in-MS-Windows-source.patch" >From 878c4c0d20bb94d9af8cb4161b1a7cbf73c7ba90 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 23 Oct 2021 20:35:18 -0700 Subject: [PATCH] Include first in MS-Windows source --- lib-src/ntlib.c | 3 +++ nt/addpm.c | 4 ++++ nt/cmdproxy.c | 3 +++ nt/ddeclient.c | 3 +++ nt/preprep.c | 3 +++ nt/runemacs.c | 3 +++ 6 files changed, 19 insertions(+) diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c index bcbc006431..f1c68cb1b2 100644 --- a/lib-src/ntlib.c +++ b/lib-src/ntlib.c @@ -20,6 +20,9 @@ Copyright (C) 1994, 2001-2021 Free Software Foundation, Inc. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +#define DEFER_MS_W3_H +#include + #include #include #include diff --git a/nt/addpm.c b/nt/addpm.c index f54a6ea9f7..f07e4c2c5a 100644 --- a/nt/addpm.c +++ b/nt/addpm.c @@ -34,6 +34,10 @@ installed, then the DDE fallback for creating icons the Windows 3.1 progman way will be used instead, but that is prone to lockups caused by other applications not servicing their message queues. */ + +#define DEFER_MS_W3_H +#include + #include #include #include diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c index 224f68b1e8..2bc03673d5 100644 --- a/nt/cmdproxy.c +++ b/nt/cmdproxy.c @@ -27,6 +27,9 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +#define DEFER_MS_W3_H +#include + #include #include /* va_args */ diff --git a/nt/ddeclient.c b/nt/ddeclient.c index c577bfcfa9..1c1f7679ea 100644 --- a/nt/ddeclient.c +++ b/nt/ddeclient.c @@ -16,6 +16,9 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +#define DEFER_MS_W3_H +#include + #include #include #include diff --git a/nt/preprep.c b/nt/preprep.c index 78ed1c3238..48c55ef221 100644 --- a/nt/preprep.c +++ b/nt/preprep.c @@ -21,6 +21,9 @@ based on code from addsection.c */ +#define DEFER_MS_W3_H +#include + #include #include #include diff --git a/nt/runemacs.c b/nt/runemacs.c index 308e856be2..cce4904d88 100644 --- a/nt/runemacs.c +++ b/nt/runemacs.c @@ -40,6 +40,9 @@ Copyright (C) 2001-2021 Free Software Foundation, Inc. /* #define CHOOSE_NEWEST_EXE */ +#define DEFER_MS_W3_H +#include + #include #include #include -- 2.31.1 --------------6E1856DBE619050D3712ED54--