Implement mono_gc_alloc_fixed on Boehm to be uncollectable. This matches SGen behavio...
[mono.git] / mcs / class / corlib / System.Reflection.Emit / StringToken.cs
index 3f0083310c83ea4faec4d25f9ca28f8c7f91edb8..ece7c0c62105b32b4190623fc1d499ad13c31e97 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,23 +34,17 @@ namespace System.Reflection.Emit {
        /// <summary>
        ///  Represents the Token returned by the metadata to represent a String.
        /// </summary>
+       [ComVisible (true)]
        [Serializable]
        public struct StringToken {
 
                internal int tokValue;
 
-               static StringToken ()
-               {
-               }
-
-
                internal StringToken (int val)
                {
                        tokValue = val;
                }
 
-
-
                /// <summary>
                /// </summary>
                public override bool Equals (object obj)
@@ -63,6 +59,20 @@ namespace System.Reflection.Emit {
                        return res;
                }
 
+               public bool Equals (StringToken obj)
+               {
+                       return (this.tokValue == obj.tokValue);
+               }
+
+               public static bool operator == (StringToken a, StringToken b)
+               {
+                       return Equals (a, b);
+               }
+
+               public static bool operator != (StringToken a, StringToken b)
+               {
+                       return !Equals (a, b);
+               }
 
                /// <summary>
                ///  Tests whether the given object is an instance of
@@ -87,3 +97,4 @@ namespace System.Reflection.Emit {
 
 }
 
+#endif