[Mono-list] Making code conditional on "not running on mono"?

Stuart Ballard stuart.ballard@corp.fast.net
Fri, 16 May 2003 11:29:57 -0400

Ian MacLean wrote:
> We do somthing similar in nant. Except we use #ifdef mono.
> Another way to test if you are on windows it to check the value of 
> DirectorySeperatorchar. That won't help if you're trying to test for 
> mono since you cold be on mono on wondows.

Hey cool, I didn't know that C# had a preprocessor :)

Question to the Mono developers: Would it be worth making "/d:mono" or 
"/d:mcs" a default in mcs? That would make it possible to write code 
that compiles differently on Mono without having to specialcase your 
build scripts.

(this seems analagous to the fact that you can assume things like 
"#ifdef linux" and "#ifdef gcc" in C and get meaningful results without 
having to explicitly -D them on the commandline)


Stuart Ballard, Senior Web Developer
FASTNET - Web Solutions
(215) 283-2300, ext. 126