Mail Archives: djgpp/1999/01/18/21:11:55
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 <n AT ml DOT org>
Man will occasionally stumble over the truth, but most times he will pick himself up and carry on. -- Winston Churchill
- Raw text -