[Mono-dev] gmcs version #define

Stefanos A. stapostol at gmail.com
Wed Nov 11 10:22:53 EST 2009


According to the documentation, gmcs #defines the __MonoCS__ constant
when compiling C# code. However, it doesn't seem to provide a constant
that identifies the compiler version.

My use case: I have added a workaround to avoid some code which causes
gmcs 2.0-2.4 to choke. Since this specific issue has been reported as
fixed in the 2.6 branch, I would like to disable the workaround for
newer versions of the compiler.

Unless I have missed something obvious, this doesn't seem to be possible
right now, at least not in an automated fashion.

Does this sound like a reasonable feature? Would it be possible to add a
constant like "#define __MonoVersion__ 260" in some future version?
(where 260 is gmcs 2.6.0, 281 is gmcs 2.8.1, etc)



More information about the Mono-devel-list mailing list