2004-09-23 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Thu, 23 Sep 2004 19:29:42 +0000 (19:29 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 23 Sep 2004 19:29:42 +0000 (19:29 -0000)
* MonoCustomAttrs.cs (GetCustomAttributes): Rename the icall to
GetCustomAttributesInternal and add a 'pseudoAttrs' argument.

svn path=/trunk/mcs/; revision=34309

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/MonoCustomAttrs.cs

index 61c230c2d7dd8304082f96a03898771c4cefd2e8..89cf92569b4f2e06cba7b910deba2c7d5f824797 100644 (file)
@@ -1,5 +1,8 @@
 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
 
+       * MonoCustomAttrs.cs (GetCustomAttributes): Rename the icall to
+       GetCustomAttributesInternal and add a 'pseudoAttrs' argument.
+
        * Type.cs: Tweak Module property in 2.0 build.
 
 2004-09-23  Martin Baulig  <martin@ximian.com>
index 16d4177924d97c58d8c7fb71a7f0f666e5577c64..e223ec88db251b008f1967445f47652d4c1dbad0 100755 (executable)
@@ -40,8 +40,14 @@ namespace System
 {
        internal class MonoCustomAttrs
        {
+#if NET_2_0 || BOOTSTRAP_NET_2_0
+               internal static readonly bool pseudoAttrs = true;
+#else
+               internal static readonly bool pseudoAttrs = false;
+#endif
+
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
-               internal static extern object[] GetCustomAttributes (ICustomAttributeProvider obj);
+               internal static extern object[] GetCustomAttributesInternal (ICustomAttributeProvider obj, bool pseudoAttrs);
 
                internal static Attribute GetCustomAttribute (ICustomAttributeProvider obj,
                                                                Type attributeType,
@@ -68,7 +74,7 @@ namespace System
                                throw new ArgumentNullException ("obj");
 
                        object[] r;
-                       object[] res = GetCustomAttributes (obj);
+                       object[] res = GetCustomAttributesInternal (obj, pseudoAttrs);
                        // shortcut
                        if (!inherit && res.Length == 1)
                        {
@@ -162,7 +168,7 @@ namespace System
                                if ((btype = GetBase (btype)) != null)
                                {
                                        inheritanceLevel++;
-                                       res = GetCustomAttributes (btype);
+                                       res = GetCustomAttributesInternal (btype, pseudoAttrs);
                                }
                        } while (inherit && btype != null);
 
@@ -188,14 +194,14 @@ namespace System
                                throw new ArgumentNullException ("obj");
 
                        if (!inherit)
-                               return (object[]) GetCustomAttributes (obj).Clone ();
+                               return (object[]) GetCustomAttributesInternal (obj, pseudoAttrs).Clone ();
 
                        return GetCustomAttributes (obj, null, inherit);
                }
 
                internal static bool IsDefined (ICustomAttributeProvider obj, Type attributeType, bool inherit)
                {
-                       object [] res = GetCustomAttributes (obj);
+                       object [] res = GetCustomAttributesInternal (obj, pseudoAttrs);
                        foreach (object attr in res)
                                if (attributeType.Equals (attr.GetType ()))
                                        return true;