X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fdlr%2FRuntime%2FMicrosoft.Scripting.Core%2FCompiler%2FDelegateHelpers.cs;h=a2e5ca0a4c157c1d6e97c17d340b90375fbbaef3;hb=424595ea7043f30b0553f2842654db13baeda3ca;hp=ac8b05bec6e0f0e21fd861d34de1a5a6589219cf;hpb=340222ffe8b958cd22d9eb0388488f326845b363;p=mono.git diff --git a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs index ac8b05bec6e..a2e5ca0a4c1 100644 --- a/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs +++ b/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.cs @@ -2,31 +2,28 @@ * * Copyright (c) Microsoft Corporation. * - * This source code is subject to terms and conditions of the Microsoft Public License. A + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Microsoft Public License, please send an email to + * you cannot locate the Apache License, Version 2.0, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound - * by the terms of the Microsoft Public License. + * by the terms of the Apache License, Version 2.0. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ -using System; using Microsoft; - -#if CODEPLEX_40 +using System; using System.Dynamic.Utils; -#else -using Microsoft.Scripting.Utils; -#endif using System.Reflection; +#if FEATURE_REFEMIT using System.Reflection.Emit; +#endif -#if CODEPLEX_40 -namespace System.Linq.Expressions.Compiler { +#if !FEATURE_CORE_DLR +namespace Microsoft.Scripting.Ast.Compiler { #else -namespace Microsoft.Linq.Expressions.Compiler { +namespace System.Linq.Expressions.Compiler { #endif internal static partial class DelegateHelpers { private const MethodAttributes CtorAttributes = MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public; @@ -35,6 +32,7 @@ namespace Microsoft.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(); @@ -42,6 +40,9 @@ namespace Microsoft.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 } } }