2006-07-15 Jonathan Chambers <joncham@gmail.com>
[mono.git] / mcs / class / corlib / System.Runtime.CompilerServices / RuntimeHelpers.cs
index 27045327117f2c48eb5f38e071e8fb9b5240525b..aba41780aa536da566c498c79c047d49d606abfb 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System.Runtime.CompilerServices
 {
+#if NET_2_0
+       public static class RuntimeHelpers
+#else
        [Serializable]
        public sealed class RuntimeHelpers
+#endif
        {
-               private static int offset_to_string_data;
+#if NET_2_0
+               public delegate void TryCode (Object userData);
 
-               static RuntimeHelpers () {
-                       offset_to_string_data = GetOffsetToStringData();
-               }
+               public delegate void CleanupCode (Object userData, bool exceptionThrown);
+#endif
 
+#if !NET_2_0
                private RuntimeHelpers () {}
+#endif
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                static extern void InitializeArray (Array array, IntPtr fldHandle);
@@ -49,10 +59,9 @@ namespace System.Runtime.CompilerServices
                        InitializeArray (array, fldHandle.Value);
                }
 
-               public static int OffsetToStringData {
-                       get {
-                               return offset_to_string_data;
-                       }
+               public static extern int OffsetToStringData {
+                       [MethodImpl (MethodImplOptions.InternalCall)]
+                       get;
                }
 
 #if NET_1_1
@@ -87,7 +96,51 @@ namespace System.Runtime.CompilerServices
                        RunClassConstructor (type.Value);
                }
 
-               [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               private static extern int GetOffsetToStringData();
+#if NET_2_0
+               [MonoTODO]
+               public static void ExecuteCodeWithGuaranteedCleanup (TryCode code, CleanupCode backoutCode, Object userData) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
+               public static void PrepareConstrainedRegions () {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
+               public static void PrepareConstrainedRegionsNoOP () {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
+               public static void ProbeForSufficientStack() {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static void PrepareDelegate (Delegate d) {
+                       if (d == null)
+                               throw new ArgumentNullException ("d");
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static void PrepareMethod (RuntimeMethodHandle method) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static void PrepareMethod (RuntimeMethodHandle method, RuntimeTypeHandle[] instantiation) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public static void RunModuleConstructor (ModuleHandle module) {
+                       throw new NotImplementedException ();
+               }
+#endif
        }
 }