From dd14b60b49778cdb9c27995cc04deffdb8125676 Mon Sep 17 00:00:00 2001 From: Russell Greene Date: Mon, 28 Oct 2024 21:24:12 -0600 Subject: [PATCH] perfetto: fix macos compile On macos, does not declare clockid_t, but it's instead in , which also includes on Linux, so just include on all UNIX platforms. Fixes: a871eabc Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12064 Tested-by: Vinson Lee (cherry picked from commit ae9d3656860622ab40a9d824373bc13c32014bfc) Part-of: --- .pick_status.json | 2 +- src/util/perf/u_perfetto.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 821979cf836..473f2ee96b6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -924,7 +924,7 @@ "description": "perfetto: fix macos compile", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "a871eabcedffb4f817033b393e25ce373d977b1a", "notes": null diff --git a/src/util/perf/u_perfetto.h b/src/util/perf/u_perfetto.h index 5d8d8e4f3b6..eadf7062f2e 100644 --- a/src/util/perf/u_perfetto.h +++ b/src/util/perf/u_perfetto.h @@ -25,11 +25,12 @@ #define _UTIL_PERFETTO_H #include "util/u_atomic.h" +#include "util/detect_os.h" // On Unix, pass a clockid_t to designate which clock was used to gather the timestamp // On Windows, this paramter is ignored, and it's expected that `timestamp` comes from QueryPerformanceCounter -#ifndef _WIN32 -#include +#if DETECT_OS_POSIX +#include typedef clockid_t perfetto_clock_id; #else typedef int32_t perfetto_clock_id;