From unknown Sat Sep 13 04:26:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18366: 24.3.93; Definition of strnicmp needed for Cygwin-w32 build Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Aug 2014 18:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18366 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 18366@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14094226004442 (code B ref -1); Sat, 30 Aug 2014 18:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Aug 2014 18:16:40 +0000 Received: from localhost ([127.0.0.1]:54614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNnCZ-00019a-Jo for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55891) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNnCX-00019C-8G for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNnCI-0007U6-04 for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNnCH-0007U2-Tj for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNnCA-0003d2-EX for bug-gnu-emacs@gnu.org; Sat, 30 Aug 2014 14:16:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNnC2-0007RR-SR for bug-gnu-emacs@gnu.org; Sat, 30 Aug 2014 14:16:14 -0400 Received: from limerock04.mail.cornell.edu ([128.84.13.244]:52632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNnC2-0007RN-P1 for bug-gnu-emacs@gnu.org; Sat, 30 Aug 2014 14:16:06 -0400 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id s7UIG5Ya009476 for ; Sat, 30 Aug 2014 14:16:06 -0400 Received: from [192.168.1.4] (cpe-67-249-176-226.twcny.res.rr.com [67.249.176.226]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id s7UIG4A1031012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sat, 30 Aug 2014 14:16:05 -0400 Message-ID: <540214E3.4060208@cornell.edu> Date: Sat, 30 Aug 2014 14:16:03 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Cygwin's /usr/include/string.h, which comes from newlib, contains a definition of strnicmp; this is needed for the Cygwin-w32 build. That definition has recently been dropped from newlib, and so it will be gone in the next Cygwin release. The following patch fixes the problem. Is it OK for the release branch? === modified file 'src/cygw32.h' --- src/cygw32.h 2014-01-01 07:43:34 +0000 +++ src/cygw32.h 2014-08-30 17:51:36 +0000 @@ -33,6 +33,11 @@ #include "lisp.h" #include "coding.h" +/* The following was in /usr/include/string.h prior to Cygwin 1.7.33. */ +#ifndef strnicmp +#define strnicmp strncasecmp +#endif + extern void syms_of_cygw32 (void); extern char * w32_strerror (int error_no); === modified file 'src/w32font.c' --- src/w32font.c 2014-01-19 15:42:48 +0000 +++ src/w32font.c 2014-08-30 17:47:35 +0000 @@ -35,6 +35,8 @@ #include "w32font.h" #ifdef WINDOWSNT #include "w32.h" +#else /* CYGWIN */ +#include "cygw32.h" #endif /* Cleartype available on Windows XP, cleartype_natural from XP SP1. === modified file 'src/w32reg.c' --- src/w32reg.c 2014-01-01 07:43:34 +0000 +++ src/w32reg.c 2014-08-30 17:47:35 +0000 @@ -26,6 +26,10 @@ #include +#ifdef CYGWIN +#include "cygw32.h" +#endif + #define REG_ROOT "SOFTWARE\\GNU\\Emacs" /* Default system colors from the Display Control Panel settings. */ From unknown Sat Sep 13 04:26:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18366: 24.3.93; Definition of strnicmp needed for Cygwin-w32 build Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Aug 2014 19:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18366 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ken Brown Cc: 18366@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 18366-submit@debbugs.gnu.org id=B18366.140942614810126 (code B ref 18366); Sat, 30 Aug 2014 19:16:01 +0000 Received: (at 18366) by debbugs.gnu.org; 30 Aug 2014 19:15:48 +0000 Received: from localhost ([127.0.0.1]:54621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNo7n-0002dF-Gz for submit@debbugs.gnu.org; Sat, 30 Aug 2014 15:15:48 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:58376) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNo7i-0002cy-Es for 18366@debbugs.gnu.org; Sat, 30 Aug 2014 15:15:44 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NB400A00VRY5100@mtaout27.012.net.il> for 18366@debbugs.gnu.org; Sat, 30 Aug 2014 22:10:09 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NB4005RRVWWK140@mtaout27.012.net.il>; Sat, 30 Aug 2014 22:10:09 +0300 (IDT) Date: Sat, 30 Aug 2014 22:15:38 +0300 From: Eli Zaretskii In-reply-to: <540214E3.4060208@cornell.edu> X-012-Sender: halo1@inter.net.il Message-id: <83fvgdhjqd.fsf@gnu.org> References: <540214E3.4060208@cornell.edu> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Sat, 30 Aug 2014 14:16:03 -0400 > From: Ken Brown > > Cygwin's /usr/include/string.h, which comes from newlib, contains a > definition of strnicmp; this is needed for the Cygwin-w32 build. That > definition has recently been dropped from newlib Why did they do such a thing? > --- src/cygw32.h 2014-01-01 07:43:34 +0000 > +++ src/cygw32.h 2014-08-30 17:51:36 +0000 > @@ -33,6 +33,11 @@ > #include "lisp.h" > #include "coding.h" > > +/* The following was in /usr/include/string.h prior to Cygwin 1.7.33. */ > +#ifndef strnicmp > +#define strnicmp strncasecmp > +#endif The proper place for this kind of thing is src/conf_post.h, which will also make sure you won't need to include cygw32.h in every file that uses that function. (You'd probably need to condition this on HAVE_NTGUI in addition to __CYGWIN__.) I'd also suggest to consider whether to make this a macro or an inline function, and perhaps also condition that on the Cygwin or newlib's version rather than on #ifndef (what if newlib will add a function by that name?). But this is up to you. > Is it OK for the release branch? Yes, with the above taken care of. Thanks. From unknown Sat Sep 13 04:26:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ken Brown Subject: bug#18366: closed (Re: bug#18366: 24.3.93; Definition of strnicmp needed for Cygwin-w32 build) Message-ID: References: <54022AC5.4080106@cornell.edu> <540214E3.4060208@cornell.edu> X-Gnu-PR-Message: they-closed 18366 X-Gnu-PR-Package: emacs Reply-To: 18366@debbugs.gnu.org Date: Sat, 30 Aug 2014 19:50:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1409428204-13313-1" This is a multi-part message in MIME format... ------------=_1409428204-13313-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18366: 24.3.93; Definition of strnicmp needed for Cygwin-w32 build which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18366@debbugs.gnu.org. --=20 18366: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18366 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1409428204-13313-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18366-done) by debbugs.gnu.org; 30 Aug 2014 19:49:37 +0000 Received: from localhost ([127.0.0.1]:54630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNoeX-0003Rv-7d for submit@debbugs.gnu.org; Sat, 30 Aug 2014 15:49:37 -0400 Received: from limerock03.mail.cornell.edu ([128.84.13.243]:55903) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNoeU-0003Re-KW for 18366-done@debbugs.gnu.org; Sat, 30 Aug 2014 15:49:35 -0400 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock03.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id s7UJnS7n024314; Sat, 30 Aug 2014 15:49:28 -0400 Received: from [192.168.1.4] (cpe-67-249-176-226.twcny.res.rr.com [67.249.176.226]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id s7UJnRu3010207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 30 Aug 2014 15:49:28 -0400 Message-ID: <54022AC5.4080106@cornell.edu> Date: Sat, 30 Aug 2014 15:49:25 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18366: 24.3.93; Definition of strnicmp needed for Cygwin-w32 build References: <540214E3.4060208@cornell.edu> <83fvgdhjqd.fsf@gnu.org> In-Reply-To: <83fvgdhjqd.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18366-done Cc: 18366-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Version: 24.3.94 On 8/30/2014 3:15 PM, Eli Zaretskii wrote: >> Date: Sat, 30 Aug 2014 14:16:03 -0400 >> From: Ken Brown >> >> Cygwin's /usr/include/string.h, which comes from newlib, contains a >> definition of strnicmp; this is needed for the Cygwin-w32 build. That >> definition has recently been dropped from newlib > > Why did they do such a thing? https://sourceware.org/ml/newlib/2014/msg00309.html > The proper place for this kind of thing is src/conf_post.h, which will > also make sure you won't need to include cygw32.h in every file that > uses that function. (You'd probably need to condition this on > HAVE_NTGUI in addition to __CYGWIN__.) OK. > I'd also suggest to consider whether to make this a macro or an inline > function, and perhaps also condition that on the Cygwin or newlib's > version rather than on #ifndef (what if newlib will add a function by > that name?). But this is up to you. It was added to newlib in 1977 (as a macro), and the discussion in the URL above explains why it has long been obsolete from Cygwin's point of view. So I think I'll leave it as a macro. >> Is it OK for the release branch? > > Yes, with the above taken care of. Thanks. Done, as revision 117467. Ken ------------=_1409428204-13313-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Aug 2014 18:16:40 +0000 Received: from localhost ([127.0.0.1]:54614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNnCZ-00019a-Jo for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55891) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNnCX-00019C-8G for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNnCI-0007U6-04 for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNnCH-0007U2-Tj for submit@debbugs.gnu.org; Sat, 30 Aug 2014 14:16:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNnCA-0003d2-EX for bug-gnu-emacs@gnu.org; Sat, 30 Aug 2014 14:16:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNnC2-0007RR-SR for bug-gnu-emacs@gnu.org; Sat, 30 Aug 2014 14:16:14 -0400 Received: from limerock04.mail.cornell.edu ([128.84.13.244]:52632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNnC2-0007RN-P1 for bug-gnu-emacs@gnu.org; Sat, 30 Aug 2014 14:16:06 -0400 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id s7UIG5Ya009476 for ; Sat, 30 Aug 2014 14:16:06 -0400 Received: from [192.168.1.4] (cpe-67-249-176-226.twcny.res.rr.com [67.249.176.226]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id s7UIG4A1031012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sat, 30 Aug 2014 14:16:05 -0400 Message-ID: <540214E3.4060208@cornell.edu> Date: Sat, 30 Aug 2014 14:16:03 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.3.93; Definition of strnicmp needed for Cygwin-w32 build Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Cygwin's /usr/include/string.h, which comes from newlib, contains a definition of strnicmp; this is needed for the Cygwin-w32 build. That definition has recently been dropped from newlib, and so it will be gone in the next Cygwin release. The following patch fixes the problem. Is it OK for the release branch? === modified file 'src/cygw32.h' --- src/cygw32.h 2014-01-01 07:43:34 +0000 +++ src/cygw32.h 2014-08-30 17:51:36 +0000 @@ -33,6 +33,11 @@ #include "lisp.h" #include "coding.h" +/* The following was in /usr/include/string.h prior to Cygwin 1.7.33. */ +#ifndef strnicmp +#define strnicmp strncasecmp +#endif + extern void syms_of_cygw32 (void); extern char * w32_strerror (int error_no); === modified file 'src/w32font.c' --- src/w32font.c 2014-01-19 15:42:48 +0000 +++ src/w32font.c 2014-08-30 17:47:35 +0000 @@ -35,6 +35,8 @@ #include "w32font.h" #ifdef WINDOWSNT #include "w32.h" +#else /* CYGWIN */ +#include "cygw32.h" #endif /* Cleartype available on Windows XP, cleartype_natural from XP SP1. === modified file 'src/w32reg.c' --- src/w32reg.c 2014-01-01 07:43:34 +0000 +++ src/w32reg.c 2014-08-30 17:47:35 +0000 @@ -26,6 +26,10 @@ #include +#ifdef CYGWIN +#include "cygw32.h" +#endif + #define REG_ROOT "SOFTWARE\\GNU\\Emacs" /* Default system colors from the Display Control Panel settings. */ ------------=_1409428204-13313-1--