using System.Globalization;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
+using System.Runtime.ConstrainedExecution;
namespace System
{
public override string ToString ()
{
- return ((uint) _pointer).ToString();
+ return UIntPtr.Size < 8 ? ((uint) _pointer).ToString() : ((ulong) _pointer).ToString();
}
// Interface ISerializable
public static int Size {
get { return sizeof (void*); }
}
+
+ public static UIntPtr Add (UIntPtr pointer, int offset)
+ {
+ return (UIntPtr) (unchecked (((byte *) pointer) + offset));
+ }
+
+ public static UIntPtr Subtract (UIntPtr pointer, int offset)
+ {
+ return (UIntPtr) (unchecked (((byte *) pointer) - offset));
+ }
+
+ public static UIntPtr operator + (UIntPtr pointer, int offset)
+ {
+ return (UIntPtr) (unchecked (((byte *) pointer) + offset));
+ }
+
+ public static UIntPtr operator - (UIntPtr pointer, int offset)
+ {
+ return (UIntPtr) (unchecked (((byte *) pointer) - offset));
+ }
}
}