From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Preprocessor defines in MS-Windows build Date: Mon, 09 Jun 2008 11:42:22 +0300 Message-ID: References: <484B0458.7080604@gnu.org> <4eb0089f0806081855t120c9327of5897b87c21b616d@mail.gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1213001145 28821 80.91.229.12 (9 Jun 2008 08:45:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Jun 2008 08:45:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Robinow Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 09 10:46:22 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K5d10-00013H-Ea for ged-emacs-devel@m.gmane.org; Mon, 09 Jun 2008 10:46:10 +0200 Original-Received: from localhost ([127.0.0.1]:38917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5d0C-0002k2-VT for ged-emacs-devel@m.gmane.org; Mon, 09 Jun 2008 04:45:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K5cyX-000263-Dh for emacs-devel@gnu.org; Mon, 09 Jun 2008 04:43:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K5cyS-00025H-J2 for emacs-devel@gnu.org; Mon, 09 Jun 2008 04:43:33 -0400 Original-Received: from [199.232.76.173] (port=42435 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5cyR-000255-82 for emacs-devel@gnu.org; Mon, 09 Jun 2008 04:43:31 -0400 Original-Received: from mtaout4.012.net.il ([84.95.2.10]:20501) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K5cyR-0005KD-1G for emacs-devel@gnu.org; Mon, 09 Jun 2008 04:43:31 -0400 Original-Received: from HOME-C4E4A596F7 ([80.230.28.131]) by i_mtaout4.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K26007L7U7OLPR0@i_mtaout4.012.net.il> for emacs-devel@gnu.org; Mon, 09 Jun 2008 11:57:25 +0300 (IDT) In-reply-to: <4eb0089f0806081855t120c9327of5897b87c21b616d@mail.gmail.com> X-012-Sender: halo1@inter.net.il X-detected-kernel: by monty-python.gnu.org: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:98781 Archived-At: > Date: Sun, 8 Jun 2008 21:55:44 -0400 > From: "David Robinow" > Cc: eliz@gnu.org > > > Can someone with MSVC please see if removing these two switches causes > > any trouble? > Removing -Di386 does not seem to cause a problem (MSVC 2003). That > is, I've been running the result for 5 minutes. Thanks for testing. > I haven't tried compiling without _X86_ yet. > i386 is not present in any of the standard include files. _X86_ > appears in several places. > > _X86_ is not present by default. I think the compiler defines it by default, because it knows it was built for x86 architecture. But I cannot be sure, since the MSDN docs don't mention it, they document _M_IX86 instead... Wait, I think I found it: in Windows.h there's this snippet: #if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_IX86) #define _X86_ #endif So I think _X86_ is a legacy macro that was replaced with _M_IX86 (which has a value that indicates the architecture for which the program is built, like the GCC's -mtune switch), and the above takes care of defining it when the compiler builds a native x86 program. Again, thanks for helping us understand the meaning and effect of these macros.