Browse Source

2004-04-22 Martin Baulig <[email protected]>

	Use `#if NET_2_0 || BOOTSTRAP_2_0' for the generic reflection stuff.

svn path=/trunk/mcs/; revision=25878
Martin Baulig 22 years ago
parent
commit
84a08e67be

+ 4 - 0
mcs/class/corlib/ChangeLog

@@ -1,3 +1,7 @@
+2004-04-22  Martin Baulig  <[email protected]>
+
+	Use `#if NET_2_0 || BOOTSTRAP_2_0' for the generic reflection stuff.
+
 2004-04-09  Zoltan Varga  <[email protected]>
 
 	* corlib_test.dll.sources: Added System.Threading/TimerTest.cs.

+ 1 - 1
mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs

@@ -215,7 +215,7 @@ namespace System.Reflection.Emit {
 				throw not_after_created ();
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public override bool Mono_IsInflatedMethod {
 			get {
 				return false;

+ 1 - 1
mcs/class/corlib/System.Reflection.Emit/DynamicMethod.cs

@@ -8,7 +8,7 @@
 // (C) 2003 Ximian, Inc.  http://www.ximian.com
 //
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 
 using System;
 using System.Reflection;

+ 1 - 1
mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs

@@ -265,7 +265,7 @@ namespace System.Reflection.Emit {
 			SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public override Type[] GetGenericArguments ()
 		{
 			throw new NotImplementedException ();

+ 1 - 1
mcs/class/corlib/System.Reflection.Emit/GenericTypeParameterBuilder.cs

@@ -13,7 +13,7 @@ using System.Runtime.CompilerServices;
 using System.Globalization;
 using System.Runtime.Serialization;
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 namespace System.Reflection.Emit
 {
 	public sealed class GenericTypeParameterBuilder : Type

+ 2 - 2
mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs

@@ -38,7 +38,7 @@ namespace System.Reflection.Emit {
 		private CallingConvention native_cc;
 		private CallingConventions call_conv;
 		private bool init_locals = true;
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		private	GenericTypeParameterBuilder[] generic_params;
 #else
 		private Object generic_params; /* so offsets are the same */
@@ -306,7 +306,7 @@ namespace System.Reflection.Emit {
 			return new NotSupportedException ("The invoked member is not supported in a dynamic module.");
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		public override extern MethodInfo BindGenericParameters (Type [] types);
 

+ 1 - 1
mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs

@@ -174,7 +174,7 @@ namespace System.Reflection.Emit {
 			return DefineGlobalMethod (name, attributes, callingConvention, returnType, null, null, parameterTypes, null, null);
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public
 #else
 		internal

+ 8 - 8
mcs/class/corlib/System.Reflection.Emit/OpCodes.cs

@@ -135,7 +135,7 @@ namespace System.Reflection.Emit {
   		public static readonly OpCode Ldelem_U2;
   		public static readonly OpCode Ldelem_U4;
   		public static readonly OpCode Ldelema;
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public static readonly OpCode Ldelem_Any;
 #endif
   		public static readonly OpCode Ldfld;
@@ -210,7 +210,7 @@ namespace System.Reflection.Emit {
   		public static readonly OpCode Stelem_R4;
   		public static readonly OpCode Stelem_R8;
   		public static readonly OpCode Stelem_Ref;
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public static readonly OpCode Stelem_Any;
 #endif
   		public static readonly OpCode Stfld;
@@ -238,12 +238,12 @@ namespace System.Reflection.Emit {
   		public static readonly OpCode Throw;
   		public static readonly OpCode Unaligned;
   		public static readonly OpCode Unbox;
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public static readonly OpCode Unbox_Any;
 #endif
   		public static readonly OpCode Volatile;
   		public static readonly OpCode Xor;
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public static readonly OpCode Constrained;
 #endif
 
@@ -381,7 +381,7 @@ namespace System.Reflection.Emit {
   			Isinst = new OpCode("isinst", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x75);
   			Conv_R_Un = new OpCode("conv.r.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x76);
   			Unbox = new OpCode("unbox", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x79);
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
   			Unbox_Any = new OpCode("unbox.any", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xa5);
 #endif
   			Throw = new OpCode("throw", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref, StackBehaviour.Push0, FlowControl.Throw, 0xFF, 0x7A);
@@ -407,7 +407,7 @@ namespace System.Reflection.Emit {
   			Newarr = new OpCode("newarr", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x8D);
   			Ldlen = new OpCode("ldlen", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8E);
   			Ldelema = new OpCode("ldelema", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8F);
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
   			Ldelem_Any = new OpCode("ldelem.any", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref_popi, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xA3);
 #endif
   			Ldloc_3 = new OpCode("ldloc.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x9);
@@ -433,7 +433,7 @@ namespace System.Reflection.Emit {
   			Stelem_R4 = new OpCode("stelem.r4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popr4, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA0);
   			Stelem_R8 = new OpCode("stelem.r8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popr8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA1);
   			Stelem_Ref = new OpCode("stelem.ref", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popref, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA2);
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
   			Stelem_Any = new OpCode("stelem.any", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref_popi_popref, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA4);
 #endif
   			Stloc_1 = new OpCode("stloc.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xB);
@@ -483,7 +483,7 @@ namespace System.Reflection.Emit {
   			Prefix1 = new OpCode("prefix1", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFE);
   			Prefixref = new OpCode("prefixref", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFF);
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
   			Constrained = new OpCode("constrained.", 2, OpCodeType.Prefix, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFE, 0x16);
 #endif
 		}

+ 6 - 6
mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs

@@ -41,7 +41,7 @@ namespace System.Reflection.Emit {
 	private ModuleBuilder pmodule;
 	private int class_size;
 	private PackingSize packing_size;
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 	private	GenericTypeParameterBuilder[] generic_params;
 #else
         private Object generic_params; /* so offsets don't change */
@@ -357,7 +357,7 @@ namespace System.Reflection.Emit {
 			return DefineConstructor (attributes, callingConvention, parameterTypes, null, null);
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public
 #else
 		internal
@@ -426,7 +426,7 @@ namespace System.Reflection.Emit {
 			return DefineMethod (name, attributes, callingConvention, returnType, null, null, parameterTypes, null, null);
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public
 #else
 		internal
@@ -451,7 +451,7 @@ namespace System.Reflection.Emit {
 			return DefinePInvokeMethod (name, dllName, entryName, attributes, callingConvention, returnType, null, null, parameterTypes, null, null, nativeCallConv, nativeCharSet);
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public
 #else
 		internal
@@ -522,7 +522,7 @@ namespace System.Reflection.Emit {
 			return DefineField (fieldName, type, null, null, attributes);
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public
 #else
 		internal
@@ -1262,7 +1262,7 @@ namespace System.Reflection.Emit {
 				throw new ArgumentException (argName, "Illegal name.");
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public override Type[] GetGenericArguments ()
 		{
 			if (generic_params != null)

+ 2 - 2
mcs/class/corlib/System.Reflection/MethodBase.cs

@@ -44,7 +44,7 @@ namespace System.Reflection {
 			return pi.Length;
 		}
 		
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		virtual
 #endif
 		public Object Invoke(Object obj, Object[] parameters) {
@@ -141,7 +141,7 @@ namespace System.Reflection {
 			throw new Exception ("Method is not a builder method");
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public virtual MethodInfo BindGenericParameters (Type [] types)
 		{
 			throw new NotSupportedException ();

+ 3 - 3
mcs/class/corlib/System.Reflection/MonoMethod.cs

@@ -165,7 +165,7 @@ namespace System.Reflection {
 			if (ReturnType.IsClass && ReturnType.Namespace != "")
 				return ReturnType.Namespace + "." + ReturnType.Name + " " + Name + "(" + parms + ")";
 			string generic = "";
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 			if (HasGenericParameters) {
 				Type[] gen_params = GetGenericArguments ();
 				generic = "[";
@@ -187,7 +187,7 @@ namespace System.Reflection {
 			ReflectionSerializationHolder.Serialize ( info, Name, ReflectedType, ToString(), MemberTypes.Method);
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		public override extern MethodInfo BindGenericParameters (Type [] types);
 
@@ -314,7 +314,7 @@ namespace System.Reflection {
 			return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
 		}
 
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		extern MethodInfo GetGenericMethodDefinition_impl ();
 

+ 1 - 1
mcs/class/corlib/System.Reflection/TypeDelegator.cs

@@ -229,7 +229,7 @@ namespace System.Reflection {
 			throw new NotImplementedException ();
 			//return typeImpl.IsValueTypeImpl ();
 		}
-#if NET_2_0
+#if NET_2_0 | BOOTSTRAP_NET_2_0
 		public override Type[] GetGenericArguments ()
 		{
 			throw new NotImplementedException ();

+ 1 - 1
mcs/class/corlib/System/MonoType.cs

@@ -494,7 +494,7 @@ namespace System
 			UnitySerializationHolder.GetTypeData (this, info, context);
 		}
 
-#if NET_2_0
+#if NET_2_0 || BOOTSTRAP_NET_1_2
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
 		public extern override Type [] GetGenericArguments ();
 

+ 1 - 1
mcs/class/corlib/System/Type.cs

@@ -919,7 +919,7 @@ namespace System {
 			return FullName;
 		}
 
-#if NET_2_0
+#if NET_2_0 || BOOTSTRAP_NET_1_2
 		public abstract Type[] GetGenericArguments ();
 
 		public abstract bool HasGenericArguments {