mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Use integer to obtain cpufrequency in OSX
Using a double to try to obtain cpufrequency in OSX seems to not produce anything useful (integer representation in a double). Using int64 seems to work.
This commit is contained in:
parent
d4932f753e
commit
3503dd2f17
1 changed files with 4 additions and 2 deletions
|
@ -97,7 +97,8 @@ double Sys_ClockTicksPerSecond()
|
|||
{
|
||||
static bool init = false;
|
||||
static double ret;
|
||||
size_t len = sizeof( ret );
|
||||
int64_t temp;
|
||||
size_t len = sizeof( temp );
|
||||
int status;
|
||||
|
||||
if( init )
|
||||
|
@ -105,7 +106,8 @@ double Sys_ClockTicksPerSecond()
|
|||
return ret;
|
||||
}
|
||||
|
||||
status = sysctlbyname( "hw.cpufrequency", &ret, &len, NULL, 0 );
|
||||
status = sysctlbyname( "hw.cpufrequency", &temp, &len, NULL, 0 );
|
||||
ret = double(temp);
|
||||
|
||||
if( status == -1 )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue