Date: Mon, 18 Jan 1999 21:11:29 -0500 (EST) From: Daniel Reed To: djgpp AT delorie DOT com cc: koehler AT telik DOT com Subject: Re: djgpp (dos) preproccessor directive In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Tue, 19 Jan 1999, Koehler wrote: ) #ifdef _SOME_DJGPP_FLAG_?_ ) system("del file.dos"); ) #else ) system("rm file.unix"); ) #endif If you're only using system() for rm/del, why not simply use the remove() C call? remove("file"); However, GCC will always #define unix when compiling under Linux/etc.*, so you could use #ifdef unix system("unix-centric command"); #else system("DOS-centric command"); #endif * You can see what macros are predefined using the -dM argument to cpp, ie: (21:09)root AT narnia:~# echo | cpp -dM #define linux 1 #define __ELF__ 1 #define unix 1 (21:09)root AT narnia:~# -- Daniel Reed Man will occasionally stumble over the truth, but most times he will pick himself up and carry on. -- Winston Churchill