X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <000501c1de61$4a61c540$0110a8c0@kunal> From: "Kunal Gangakhedkar" To: "Eli Zaretskii" , References: <200204012135 DOT g31LZb009835 AT envy DOT delorie DOT com> <200204020303 DOT g3233Zt12075 AT envy DOT delorie DOT com> <9b84a27b DOT 0204021027 DOT 2d256e84 AT posting DOT google DOT com> <200204021832 DOT g32IWW421701 AT envy DOT delorie DOT com> <9b84a27b DOT 0204070512 DOT 2538ae43 AT posting DOT google DOT com> <7458-Sun07Apr2002182012+0300-eliz AT is DOT elta DOT co DOT il> Subject: Re: Preprocessor directives Date: Sun, 7 Apr 2002 23:53:11 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- Reply-To: djgpp AT delorie DOT com > I don't think there's a general, compiler-independent way of getting > that information. Each compiler should have this documented > somewhere. But then, the problem remains to select a proper compiler.... 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). 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. Like, if I can find out if it is WinNT or Win9x, then probably my ways of initialization may differ(e.g. initialization of threading subsystem). Or maybe, I can restrict my app to run on say WinNT only. AFAIK, if we follow GNU specs, then GNU defines certain #define macros which allow the programmer to find out the OS info (at least the version). This makes life much easier. I mean, then where do the macros __MSDOS__ or MSDOS come from, which allow me to see that the OS I'm using is an MSDOS compatible (???) or not?? Then, to select a proper compiler, I need to know all the internal details of the compiler & its interactions with the OS. Or at least, I have to spend some time reading the docs of the compiler for that. If we follow certain specific rules, which will allow to generalize such a task, I think that'll be of great help to all. Pls. correct me if I'm wrong anyway. Because, I want to understand this to the max possible extent, since we have a paper on compilers in my next semester of MCA. Kunal ---------------------- Behind every great computer sits a skinny little geek.