mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-22 04:10:40 +01:00
perfetto: fix macos compile
On macos, <sys/types.h> does not declare clockid_t, but it's instead in <time.h>, which also includes <sys/types.h> on Linux, so just include <time.h> on all UNIX platforms. Fixes:a871eabcCloses: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12064 Tested-by: Vinson Lee <vlee@freedesktop.org> (cherry picked from commitae9d365686) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32119>
This commit is contained in:
parent
349687c73a
commit
dd14b60b49
2 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 <sys/types.h>
|
||||
#if DETECT_OS_POSIX
|
||||
#include <time.h>
|
||||
typedef clockid_t perfetto_clock_id;
|
||||
#else
|
||||
typedef int32_t perfetto_clock_id;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue