delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/08/00:53:43

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Mon, 8 Apr 2002 08:50:27 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Kunal Gangakhedkar <kgangakhedkar AT hotpop DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Preprocessor directives
In-Reply-To: <000501c1de61$4a61c540$0110a8c0@kunal>
Message-ID: <Pine.SUN.3.91.1020408084624.28095C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 7 Apr 2002, Kunal Gangakhedkar wrote:

> If I'm building an app. which needs to be cross-platform portable,
> then this kind of decision is quite important.
> If the compiler does not allow me to detect at least the kind of OS I'm
> using,
> it is of no use. ( I agree that the arch. specification need not be taken
> from the
> compiler, but at least the OS specs are needed).

I think most (if not all) MS-DOS compilers have __MSDOS__ defined.

However, you will have to verify that for each compiler you want to be 
supported by your program.  It's easy once you have the compiler 
available--just write a simple source file that uses #ifdef __MSDOS__, 
and see if the conditional part is compiled.

Since you cannot really say a certain compiler is supported without 
trying to compile the program with that compiler, checking whether it 
supports __MSDOS__ is the least of your trouble.

> For example, if I'm writing an app for say MS Win-32 platform, which
> depending
> on the kernel does some additional things, then the OS information is quite
> imp.

Most Windows compilers have _WIN32 defined, IIRC.

> Then, to select a proper compiler, I need to know all the internal details
> of the compiler
> & its interactions with the OS.

No, you don't need that, at least not for the macros we were discussing 
here.

- Raw text -


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