Merge pull request #819 from brendanzagaeski/patch-1
[mono.git] / mcs / class / dlr / Runtime / Microsoft.Scripting.Core / Compiler / DelegateHelpers.cs
index 47079f8894d67ffa74a0c61521193829c79bf0f5..a2e5ca0a4c157c1d6e97c17d340b90375fbbaef3 100644 (file)
 using System;
 using System.Dynamic.Utils;
 using System.Reflection;
+#if FEATURE_REFEMIT
 using System.Reflection.Emit;
+#endif
 
-#if CLR2
+#if !FEATURE_CORE_DLR
 namespace Microsoft.Scripting.Ast.Compiler {
 #else
 namespace System.Linq.Expressions.Compiler {
@@ -30,6 +32,7 @@ namespace System.Linq.Expressions.Compiler {
         private static readonly Type[] _DelegateCtorSignature = new Type[] { typeof(object), typeof(IntPtr) };
 
         private static Type MakeNewCustomDelegate(Type[] types) {
+#if FEATURE_REFEMIT
             Type returnType = types[types.Length - 1];
             Type[] parameters = types.RemoveLast();
 
@@ -37,6 +40,9 @@ namespace System.Linq.Expressions.Compiler {
             builder.DefineConstructor(CtorAttributes, CallingConventions.Standard, _DelegateCtorSignature).SetImplementationFlags(ImplAttributes);
             builder.DefineMethod("Invoke", InvokeAttributes, returnType, parameters).SetImplementationFlags(ImplAttributes);
             return builder.CreateType();
+#else
+            throw new NotSupportedException("Method signature not supported on this platform");
+#endif
         }
     }
 }