Mail Archives: djgpp/2002/04/08/00:53:43
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 -