Mail Archives: djgpp/1997/03/04/06:31:32
On Mon, 3 Mar 1997, Jon A. Cruz wrote:
> I have a quick question. I'm working on some code for true
> cross-platform compiling (i.e. DOS, MS Windows, Windows CE, Unix, Mac,
> Newton, etc., not just Win95 and WinNT) and was looking for suggestions
> on what #defines I should use?
>
> What are you using, and why?
Use __DJGPP__ for DJGPP-specific code, __MSDOS__ for MSDOS-specific
code (that should work for other MSDOS compilers as well), WIN32 or
_WIN32 for Windows 9x/NT platforms.
However, it is usually a better idea to try to identify the
functionality that is specific to different platforms, because some
platforms have similar features. For example, both MSDOS and Windows
(and OS/2) have drive letters and backslashes in the pathnames, so you
might define a symbol, say, MS_PATHNAMES that is non-zero on all these
platforms, and condition code fragments on that symbol, instead of
enumerating all the systems that should use it. A project-wide header
can then define MS_PATHNAMES for all the different platforms.
- Raw text -