X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "Tonu Aas" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: preprocesser directives Date: Fri, 25 Jan 2002 11:33:53 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Lines: 23 Message-ID: <3c512861$0$149$bb624dac@diablo.uninet.ee> NNTP-Posting-Host: 194.204.53.21 X-Trace: 1011951713 diablo.uninet.ee 149 194.204.53.21 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > Does anyone know of any preprocessor directives > I can write in a computer program to distinquish between DOS and UNIX? Just make some platform.h and include it into all your modules. In it you just define OS specific stuff: #define _UNDER_DOS #define _UNDER_UNIX also you can define computer, OS, compiler, addressing mode, CPU mode specific values. Also you can define integral types like INT8, INT16, INT32. Its strange that you cant trust integer size. Even short int and long int can be whatever size. C and C++ languages are so platform specific and it is very hard to write portable code. Tõnu.