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

Martin Baulig martin@gnome.org
17 May 2003 17:59:14 +0200

Jonathan Pryor <jonpryor@vt.edu> writes:

> <snip/>
> > 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 already exists.  From the man page:
>    NOTES
>        During compilation the MCS compiler defines the __MonoCS__
>        symbol, this can be used by pre-processor instructions to compile
>        Mono  C#  compiler specific code.

That's always defined when compiling with mcs, no matter whether you're using the .NET or
the Mono runtime.

Martin Baulig