mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-10 09:41:13 +00:00
Fix compilation on GCC7.
This commit is contained in:
parent
9578c23aa1
commit
0937068dad
1 changed files with 8 additions and 9 deletions
|
@ -146,15 +146,14 @@ void CalculateCPUSpeed()
|
||||||
PerfToMillisec = PerfToSec = 0.;
|
PerfToMillisec = PerfToSec = 0.;
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
// [MK] read from perf values if we can
|
// [MK] read from perf values if we can
|
||||||
struct perf_event_attr pe =
|
struct perf_event_attr pe;
|
||||||
{
|
memset(&pe,0,sizeof(struct perf_event_attr));
|
||||||
.type = PERF_TYPE_HARDWARE,
|
pe.type = PERF_TYPE_HARDWARE;
|
||||||
.size = sizeof(struct perf_event_attr),
|
pe.size = sizeof(struct perf_event_attr);
|
||||||
.config = PERF_COUNT_HW_INSTRUCTIONS,
|
pe.config = PERF_COUNT_HW_INSTRUCTIONS;
|
||||||
.disabled = 1,
|
pe.disabled = 1;
|
||||||
.exclude_kernel = 1,
|
pe.exclude_kernel = 1;
|
||||||
.exclude_hv = 1
|
pe.exclude_hv = 1;
|
||||||
};
|
|
||||||
int fd = syscall(__NR_perf_event_open, &pe, 0, -1, -1, 0);
|
int fd = syscall(__NR_perf_event_open, &pe, 0, -1, -1, 0);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue