I am using Lazarus v0.9.30.2 Windows 64 bits in Windows 7 64 bit
Lazarus complain "mtpcpu.pas(53,87) Error: Call by var for arg no. 3 has to match exactly: Got "LongWord" expected "QWord""
Here is solution:
function GetSystemThreadCount: integer;
// returns a good default for the number of threads on this system
{$IF defined(windows)}
//returns total number of processors available to system including logical hyperthreaded processors
var
i: Integer;
ProcessAffinityMask, SystemAffinityMask: DWORD; <---
Change to
{$IF defined(win64)}
ProcessAffinityMask, SystemAffinityMask: QWORD;
{$Else}
ProcessAffinityMask, SystemAffinityMask: DWORD;
{$Endif}