[Mono-devel-list] Do we really need ONLY_1_0 and ONLY_1_1?

Atsushi Eno atsushi at ximian.com
Tue Apr 27 00:31:20 EDT 2004


Hello,

I noticed that in mcs/class/README we suggest to use conditional
directive named ONLY_1_0 and ONLY_1_1 in the class libraries (and
actually used in System.Data), for members that are removed after
.NET 2.0.

	#if ONLY_1_0 || ONLY_1_1
	   ...
	#endif

But since our switches are applied accumulative (we don't use
-d:NET_2_0 without -d:NET_1_1), I would suggest to replace them like:

	#if NET_2_0
	  /* empty */
	#else
	   code body
	#endif

Then "-d:NET_1_1" will be sufficient for our build condition.

We had better provide better description on how to use those switches.
If based on the proposal above, it is like:

1) For members only after .NET Framework 1.1
	#if NET_1_1
	  code
	#endif

2) For members only after .NET Framework 2.0
	#if NET_2_0
	  code
	#endif

3) For members removed after .NET Framework 1.1
e.g. System.Xml.XmlTextReader.ReadInnerXml()
	#if NET_1_1
	  /* empty */
	#else
	  ...
	#endif

4) For members removed after .NET Framework 2.0
e.g. System.Data.FieldNameLookup

	#if NET_2_0
	  /* empty */
	#else
	  ...
	#endif

5) For members removed only in .NET Framework 1.1

	#if NET_2_0
	  new definition
	#elif NET_1_1
	  /* empty */
	#else
	  old definition
	#endif

This way does not premise that the case when .NET 1.0 and .NET 2.0
uses the common code, but it is unlikely to happen.

Thanks,
Atsushi Eno





More information about the Mono-devel-list mailing list