[ale] Kinda Off Topic

Benjamin Scherrey scherrey at gte.net
Wed Dec 2 22:20:48 EST 1998


    I'm not aware of a universal macro for OS identification. Different
compilers have different ideas generally. However, nothing prevents you
from simply doing your own and utilizing it in your Makefile. Make a DOS,
Windows, and Unix flavour target for your code that uses the -D command
line option that will define your OS for you (and any other param you
want). This has worked well for me in the past as I specialize in
platform-independent software development (generally in C++).

    Another alternative that is getting to be more and more realistic is
the use of an API wrapper. Mingw32, Cygin32 and GNU-Win32 are all
libraries that let you pretend to be in a proper Linux environment when
you're really only running MS-Windows. A lot of UNIX software has been
ported to Windows with these tools. The egcs C++ compiler gets good
support from these tools from a guy named Mumit Khan ( check out
http://www.xraylith.wise.edu/~khan/software/gnu-win32/ for details ) who
also wrote one of the better online intros to the STL way back when it was
first proposed.

    Good luck & later,

        Ben Scherrey

Ryan wrote:

>     I have a programming question for y'all.  I have been studying C &
> C++ for a few years now and have wondered if there is a macro which I
> can use in the pre-processing code that will auto-magically determine
> whether I am using a DOS based system or LINUX.  I have begun to write
> code for school as well as work and this would allow me to write one
> program that will run on either system yet would be able to use
> certain functions dependent on the system
>
>     Any help would be greatly appreciated.
>
>         Ryan
>
> --
> You mean you paid MONEY for Service Pack '98????






More information about the Ale mailing list