[Mono-list] detecting mono or microsoft compiler with preprocessor

Peter Williams peter@newton.cx
Fri, 03 Dec 2004 17:25:32 -0500

On Fri, 2004-12-03 at 17:44 +0100, Fabien Meghazi wrote:
> Hi all,
> Is there a #define preprocessor definition that would allow to use
> "if" "else" preprocessor statements for conditionnal compiling for
> mono and microsoft compiler ?

As Peter Bartok said, there is, but you should probably try to avoid
using that fact. You can compile an assembly with MCS and run it on the
Microsoft runtime, or vice versa, so which compiler is being used
doesn't really tell you about the runtime. And even if it did, it's
preferable to have your assembly be runtime-agnostic. (Although of
course sometimes this isn't possible.)


Peter Williams                          peter@newton.cx

"[Ninjas] are cool; and by cool, I mean totally sweet."
                              -- REAL Ultimate Power