emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preprocessor defines in MS-Windows build


From: Eli Zaretskii
Subject: Re: Preprocessor defines in MS-Windows build
Date: Mon, 09 Jun 2008 11:42:22 +0300

> Date: Sun, 8 Jun 2008 21:55:44 -0400
> From: "David Robinow" <address@hidden>
> Cc: address@hidden
> 
> > 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]