Merge pull request #487 from mayerwin/patch-1
[mono.git] / mcs / class / corlib / System / MonoCustomAttrs.cs
index dda41dd8c767c6c91ef9a0e19950bca9e84a8eca..14641fbe66119662e4a5a903a73eb3316fc13627 100644 (file)
@@ -35,7 +35,10 @@ using System;
 using System.Reflection;
 using System.Collections;
 using System.Runtime.CompilerServices;
+#if !FULL_AOT_RUNTIME
 using System.Reflection.Emit;
+#endif
+
 using System.Collections.Generic;
 
 namespace System
@@ -48,7 +51,11 @@ namespace System
                static bool IsUserCattrProvider (object obj)
                {
                        Type type = obj as Type;
+#if !FULL_AOT_RUNTIME
                        if ((type is MonoType) || (type is TypeBuilder))
+#else
+                       if (type is MonoType)
+#endif
                                return false;
                        if ((obj is Type))
                                return true;
@@ -402,8 +409,7 @@ namespace System
                                return new AttributeUsageAttribute (AttributeTargets.Class);
 
                        AttributeUsageAttribute usageAttribute = null;
-                       object[] attribs = GetCustomAttributes (attributeType,
-                               MonoCustomAttrs.AttributeUsageType, false);
+                       object[] attribs = GetCustomAttributes (attributeType, typeof(AttributeUsageAttribute), false);
                        if (attribs.Length == 0)
                        {
                                // if no AttributeUsage was defined on the attribute level, then
@@ -435,7 +441,6 @@ namespace System
                        return ((AttributeUsageAttribute) attribs[0]);
                }
 
-               private static readonly Type AttributeUsageType = typeof(AttributeUsageAttribute);
                private static readonly AttributeUsageAttribute DefaultAttributeUsage =
                        new AttributeUsageAttribute (AttributeTargets.All);