Ejemplo n.º 1
0
        public static UIntPtr Add(UIntPtr pointer, int offset)
        {
#if LESSTHAN_NET40
            if (UIntPtr.Size == 4)
            {
                return(new UIntPtr(unchecked ((uint)((int)pointer + offset))));
            }
            if (UIntPtr.Size == 8)
            {
                return(new UIntPtr(unchecked ((ulong)((long)pointer + offset))));
            }
            throw new NotSupportedException("Not supported platform");
#else
            return(UIntPtr.Add(pointer, offset));
#endif
        }
Ejemplo n.º 2
0
        public static UIntPtr Add(UIntPtr pointer, int offset)
        {
#if LESSTHAN_NET40
            switch (UIntPtr.Size)
            {
            case 4:
                return(new UIntPtr(unchecked ((uint)((int)pointer + offset))));

            case 8:
                return(new UIntPtr(unchecked ((ulong)((long)pointer + offset))));

            default:
                throw new NotSupportedException("Not supported platform");
            }
#else
            return(UIntPtr.Add(pointer, offset));
#endif
        }