Browse Source

build: use MOBILE_DYNAMIC instead of MONODROID

Some conditional compilation shouldn't really
be bound to MONODROID, instead add a new define
that can be reused, MOBILE_DYNAMIC.
Aaron Bockover 12 years ago
parent
commit
975d419550

+ 1 - 1
mcs/build/profiles/monodroid.make

@@ -12,7 +12,7 @@ profile-check:
 	@:
 
 DEFAULT_REFERENCES = -r:mscorlib.dll
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MONODROID -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MOBILE_DYNAMIC -d:MONODROID -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
 FRAMEWORK_VERSION = 2.1
 NO_TEST = yes
 

+ 6 - 6
mcs/class/System.Core/System.Runtime.CompilerServices/ExecutionScope.cs

@@ -33,7 +33,7 @@ using System.Linq.Expressions;
 
 namespace System.Runtime.CompilerServices {
 
-#if MONODROID
+#if MOBILE_DYNAMIC
 	[Obsolete ("do not use this type", true)]
 #endif
 	public class ExecutionScope {
@@ -42,12 +42,12 @@ namespace System.Runtime.CompilerServices {
 		public object [] Locals;
 		public ExecutionScope Parent;
 
-#if !MONODROID
+#if !MOBILE_DYNAMIC
 		internal CompilationContext context;
 #endif
 		internal int compilation_unit;
 
-#if !MONODROID
+#if !MOBILE_DYNAMIC
 		ExecutionScope (CompilationContext context, int compilation_unit)
 		{
 			this.context = context;
@@ -69,7 +69,7 @@ namespace System.Runtime.CompilerServices {
 #endif
 		public Delegate CreateDelegate (int indexLambda, object [] locals)
 		{
-#if MONODROID
+#if MOBILE_DYNAMIC
 			throw new NotSupportedException ();
 #else
 			return context.CreateDelegate (
@@ -80,7 +80,7 @@ namespace System.Runtime.CompilerServices {
 
 		public object [] CreateHoistedLocals ()
 		{
-#if MONODROID
+#if MOBILE_DYNAMIC
 			throw new NotSupportedException ();
 #else
 			return context.CreateHoistedLocals (compilation_unit);
@@ -89,7 +89,7 @@ namespace System.Runtime.CompilerServices {
 
 		public Expression IsolateExpression (Expression expression, object [] locals)
 		{
-#if MONODROID
+#if MOBILE_DYNAMIC
 			throw new NotSupportedException ();
 #else
 			return context.IsolateExpression (this, locals, expression);

+ 1 - 1
mcs/mcs/assign.cs

@@ -363,7 +363,7 @@ namespace Mono.CSharp {
 			return this;
 		}
 
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 		public override System.Linq.Expressions.Expression MakeExpression (BuilderContext ctx)
 		{
 			var tassign = target as IDynamicAssign;

+ 4 - 4
mcs/mcs/dynamic.cs

@@ -13,7 +13,7 @@ using System;
 using System.Linq;
 using SLE = System.Linq.Expressions;
 
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 using System.Dynamic;
 #endif
 
@@ -63,7 +63,7 @@ namespace Mono.CSharp
 	//
 	public class RuntimeValueExpression : Expression, IDynamicAssign, IMemoryLocation
 	{
-#if !NET_4_0 && !MONODROID
+#if !NET_4_0 && !MOBILE_DYNAMIC
 		public class DynamicMetaObject
 		{
 			public TypeSpec RuntimeType;
@@ -146,7 +146,7 @@ namespace Mono.CSharp
 			return base.MakeExpression (ctx);
 #else
 
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 				if (type.IsStruct && !obj.Expression.Type.IsValueType)
 					return SLE.Expression.Unbox (obj.Expression, type.GetMetaInfo ());
 
@@ -181,7 +181,7 @@ namespace Mono.CSharp
 			return this;
 		}
 
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 		public override SLE.Expression MakeExpression (BuilderContext ctx)
 		{
 #if STATIC

+ 6 - 6
mcs/mcs/expression.cs

@@ -657,7 +657,7 @@ namespace Mono.CSharp
 				return is_checked ? SLE.Expression.NegateChecked (expr) : SLE.Expression.Negate (expr);
 			case Operator.LogicalNot:
 				return SLE.Expression.Not (expr);
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 			case Operator.OnesComplement:
 				return SLE.Expression.OnesComplement (expr);
 #endif
@@ -1340,7 +1340,7 @@ namespace Mono.CSharp
 		}
 
 
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 		public override SLE.Expression MakeExpression (BuilderContext ctx)
 		{
 			var target = ((RuntimeValueExpression) expr).MetaObject.Expression;
@@ -1922,7 +1922,7 @@ namespace Mono.CSharp
 			temp_storage.Release (ec);
 		}
 
-#if (NET_4_0 || MONODROID) && !STATIC
+#if (NET_4_0 || MOBILE_DYNAMIC) && !STATIC
 		public override SLE.Expression MakeExpression (BuilderContext ctx)
 		{
 			return SLE.Expression.Default (type.GetMetaInfo ());
@@ -7421,7 +7421,7 @@ namespace Mono.CSharp
 			return data;
 		}
 
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 		public override SLE.Expression MakeExpression (BuilderContext ctx)
 		{
 #if STATIC
@@ -9618,7 +9618,7 @@ namespace Mono.CSharp
 
 		public SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source)
 		{
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 			return SLE.Expression.ArrayAccess (ea.Expr.MakeExpression (ctx), MakeExpressionArguments (ctx));
 #else
 			throw new NotImplementedException ();
@@ -9797,7 +9797,7 @@ namespace Mono.CSharp
 #else
 			var value = new[] { source.MakeExpression (ctx) };
 			var args = Arguments.MakeExpression (arguments, ctx).Concat (value);
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 			return SLE.Expression.Block (
 					SLE.Expression.Call (InstanceExpression.MakeExpression (ctx), (MethodInfo) Setter.GetMetaInfo (), args),
 					value [0]);

+ 1 - 1
mcs/mcs/location.cs

@@ -222,7 +222,7 @@ namespace Mono.CSharp
 		// </summary>
 		static public void Initialize (List<SourceFile> files)
 		{
-#if NET_4_0 || MONODROID
+#if NET_4_0 || MOBILE_DYNAMIC
 			source_list.AddRange (files);
 #else
 			source_list.AddRange (files.ToArray ());

+ 1 - 1
mcs/mcs/support.cs

@@ -36,7 +36,7 @@ namespace Mono.CSharp {
 			return System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode (obj);
 		}
 	}
-#if !NET_4_0 && !MONODROID
+#if !NET_4_0 && !MOBILE_DYNAMIC
 	public class Tuple<T1, T2> : IEquatable<Tuple<T1, T2>>
 	{
 		public Tuple (T1 item1, T2 item2)