* more robust calculation of TBITS_SHIFT

This commit is contained in:
florian 2022-11-06 22:33:38 +01:00
parent 236febb148
commit 9c8f362acc

View File

@ -15,7 +15,17 @@
{****************************************************************************}
const
TBITS_SHIFT = BsrDWord(bitsizeof(TBitsBase));
TBITS_SHIFT =
{$if sizeof(TBitsBase) = sizeof(word)}
4
{$elseif sizeof(TBitsBase) = sizeof(dword)}
5
{$elseif sizeof(TBitsBase) = sizeof(qword)}
6
{$else}
{$error unknown TBitsBase}
{$endif}
;
TBITS_MASK = 1 shl TBITS_SHIFT - 1;
Procedure BitsErrorFmt (const Msg : string; const Args : array of const);