Implement mono_gc_alloc_fixed on Boehm to be uncollectable. This matches SGen behavio...
[mono.git] / mcs / class / corlib / System.Reflection.Emit / PropertyToken.cs
index 5564e57c70d36058de5ef1eddb4617dffd30cdae..e1f2c846965167f1cb4c3028d00b1040977df0ce 100644 (file)
@@ -25,6 +25,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !FULL_AOT_RUNTIME
+using System.Runtime.InteropServices;
 
 namespace System.Reflection.Emit {
 
@@ -32,27 +34,19 @@ namespace System.Reflection.Emit {
        /// <summary>
        ///  Represents the Token returned by the metadata to represent a Property.
        /// </summary>
+       [ComVisible (true)]
        [Serializable]
        public struct PropertyToken {
 
                internal int tokValue;
 
-               public static readonly PropertyToken Empty;
-
-
-               static PropertyToken ()
-               {
-                       Empty = new PropertyToken ();
-               }
-
+               public static readonly PropertyToken Empty = new PropertyToken ();
 
                internal PropertyToken (int val)
                {
                        tokValue = val;
                }
 
-
-
                /// <summary>
                /// </summary>
                public override bool Equals (object obj)
@@ -67,6 +61,20 @@ namespace System.Reflection.Emit {
                        return res;
                }
 
+               public bool Equals (PropertyToken obj)
+               {
+                       return (this.tokValue == obj.tokValue);
+               }
+
+               public static bool operator == (PropertyToken a, PropertyToken b)
+               {
+                       return Equals (a, b);
+               }
+
+               public static bool operator != (PropertyToken a, PropertyToken b)
+               {
+                       return !Equals (a, b);
+               }
 
                /// <summary>
                ///  Tests whether the given object is an instance of
@@ -91,3 +99,4 @@ namespace System.Reflection.Emit {
 
 }
 
+#endif