Exemple #1
0
        public static UIntPtr Subtract(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.Subtract(pointer, offset));
#endif
        }
Exemple #2
0
        public static UIntPtr Subtract(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.Subtract(pointer, offset));
#endif
        }