delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/25/13:19:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Shankar Unni <shankarunni AT netscape DOT net>
Subject: Re: [Runtime macro] Where can I find those stuffs?
Date: Wed, 25 Feb 2004 10:19:14 -0800
Lines: 29
Message-ID: <c1iov5$jh9$1@sea.gmane.org>
References: <001f01c3fb08$662f9390$1701a8c0 AT Alvyn>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: adsl-68-122-43-220.dsl.pltn13.pacbell.net
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
In-Reply-To: <001f01c3fb08$662f9390$1701a8c0@Alvyn>

Alvyn Liang wrote:

> I also find out there are so many macros such as __i486__, __i586__,
> _M_IX86, _X86_, WIN32_LEAN_AND_MEAN, __USE_W32_SOCKETS... , etc. They are
> not in the textbooks I bought. I bought "GCC The complete Reference" and
> some c++ books, they do not mention so many variables. Can someone tell me
> where I can find the information of those Macros?

That's a long story, now..

* Some macros are built in to GCC (__i486__, etc.)
* Some macros are required by the platform header files for enabling or 
disabling certain bits of functionality (e.g. WIN32_LEAN_AND_MEAN, etc.) 
For these, the rule is that you use them if the platform documentation 
tells you to use them. (I.e. *RTFM* first!)

There's a nice way to tell you what the "standard GCC macros" for a 
platform are:

   % touch xx.c      # empty file
   % gcc -dN -E xx.c   # or -dM

This will dump out a nice dump of all the macros that are compiled in to 
cc1, or are passed in from the spec file.  -dN will print only the 
names, while -dM will print the full #define statements.

Really useful..




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019