Mail Archives: djgpp/1997/07/30/13:32:13
Nate Eldredge (eldredge AT ap DOT net) writes:
> At 05:34 7/24/1997 +0100, you wrote:
>>Now, how do I in a portable way test for which C compiler might be available?
>>I can do it easily in 4DOS, but COMMAND.COM compatibility is a lot harder...
> Well, there's always the method of <gasp> asking the user! My approach would
> be to define $(CC) = gcc at the top of the makefile, and let the user change
> it if they want.
> The better question is, what compiler besides GCC would be available that
> would work?
What about predefined macros? Info cpp macros predefined. There're bunch,
including I think, __GNU_C__ and __DJGPP__ in DJGPP. Presumably others
such as Microsoft C++ and Borland C++ have their own, like __BORLAND__.
Then you make conditional compile statements like so:
#if defined __GNU_C__
putpixel(dx,dy,17);
#elif defined __BORLAND_C__
plotpixel(dx,dy,17,NULL);
#else
#error I only compile with DJGPP or Borland
#endif
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -