// 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);
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
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
}
}