On a 64-bit system, this function generates a range error if processing an _IOC_READ. Because SizeInt and TIOCtlRequest are defined at the system level, the best fix appears to be disabling the range check for the duration of the computation.
function _IOC(dir, _type, nr: Longword; size: SizeInt): TIOCtlRequest; begin {$push }{$R- } // If dir is 2 (_IOC_READ) this will set the MSB hence a range error _IOC := (dir shl _IOC_DIRSHIFT) or (_type shl _IOC_TYPESHIFT) or (nr shl _IOC_NRSHIFT) or (size shl _IOC_SIZESHIFT); {$pop } end;
On a 64-bit system, this function generates a range error if processing an _IOC_READ. Because SizeInt and TIOCtlRequest are defined at the system level, the best fix appears to be disabling the range check for the duration of the computation.
function _IOC(dir, _type, nr: Longword; size: SizeInt): TIOCtlRequest; begin {$push }{$R- } // If dir is 2 (_IOC_READ) this will set the MSB hence a range error _IOC := (dir shl _IOC_DIRSHIFT) or (_type shl _IOC_TYPESHIFT) or (nr shl _IOC_NRSHIFT) or (size shl _IOC_SIZESHIFT); {$pop } end;