From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Correctly handling MinGW-w64 Date: Mon, 17 Nov 2014 05:13:12 +0100 Message-ID: <87ioieqxbb.fsf@wanadoo.es> References: <87r3x2qyjg.fsf@wanadoo.es> <546973D0.7050306@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1416197706 25964 80.91.229.3 (17 Nov 2014 04:15:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2014 04:15:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 17 05:15:00 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XqDiO-0004Og-Im for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2014 05:15:00 +0100 Original-Received: from localhost ([::1]:46026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqDiO-0002dO-3E for ged-emacs-devel@m.gmane.org; Sun, 16 Nov 2014 23:15:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqDgx-000883-Mm for emacs-devel@gnu.org; Sun, 16 Nov 2014 23:13:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqDgs-0008WK-Fc for emacs-devel@gnu.org; Sun, 16 Nov 2014 23:13:31 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:58769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqDgs-0008WC-96 for emacs-devel@gnu.org; Sun, 16 Nov 2014 23:13:26 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XqDgp-0003sl-Go for emacs-devel@gnu.org; Mon, 17 Nov 2014 05:13:23 +0100 Original-Received: from 132.red-79-158-48.staticip.rima-tde.net ([79.158.48.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Nov 2014 05:13:23 +0100 Original-Received: from ofv by 132.red-79-158-48.staticip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Nov 2014 05:13:23 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 132.red-79-158-48.staticip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:MY1m6eOrEAgDdVzxjoNMkGXvBf8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177386 Archived-At: Paul Eggert writes: > Óscar Fuentes wrote: >> +dnl We need to distinguish MinGW32 toolset from its spin-off >> +dnl MinGW-w64. (This has nothing to do with word size.) >> +MINGW_W64=no >> +if test $opsys = mingw32; then >> + AC_CHECK_DECL(__MINGW64_VERSION_MAJOR, >> + MINGW_W64=yes, >> + MINGW_W64=no, >> + [#include <_mingw.h>]) >> + if test "$MINGW_W64" = "yes"; then >> + AC_DEFINE([MINGW_W64], 1, >> + [Define to 1 if you are using the MinGW-w64 toolset, regardless of word size.]) >> + fi >> +fi > > Why does the above need to be in configure.ac? Can the relevant code > just inspect __MINGW64_VERSION_MAJOR instead of inspecting MINGW_W64? The key here is that __MINGW64_VERSION_MAJOR is defined on a header (_mingw.h) so we would need to do #if __MINGW32__ #include <_mingw.h> #if __MINGW64_VERSION_MAJOR ... > Or, if we prefer to use our own symbol, can we just put something like > this: > > #ifdef __MINGW64_VERSION_MAJOR > # define MINGW_W64 1 > #endif > > into ms-w32.h or into some other header specific to Microsoft Windows? We don't have a header that is included by all the .c files, right? (apart from configure.h, of course.) The need to test for MINGW_W64 can occur anywhere. OTOH, I would be happy to use any practical solution that avoids configure.ac.