The gettickcount in the {$else} of the gettickcount function is interpreted as the return value of a procedure. (result in Delphi)
Depending on mode, this might lead to eternal recursion
Solution: just like in the windows case, qualify with unitname so
{$else}
Result := SysUtils.GetTickCount mod High(LongInt);