intel/perf: Move sysmacros.h include from header to implementation

sysmacros.h defines macros `minor()` and `major()`. These macros conflict
with a definition of `minor()` in the Perfetto SDK header. Move the
sysmacros.h include to intel_perf.c because the Perfetto header is only
included at the same time as intel_perf.h not *.c (in intel_driver_ds.cc).

Unbeknown to anyone, the definition of `minor()` in the Perfetto header is
being replaced with the macro. See the MR attachment for an example.

Signed-off-by: Renato Pereyra <renatopereyra@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29974>
This commit is contained in:
Renato Pereyra 2024-06-28 16:31:10 -05:00 committed by Marge Bot
parent 4aa3b2d3ad
commit de0d237ab0
2 changed files with 7 additions and 6 deletions

View file

@ -25,6 +25,13 @@
#include <sys/types.h>
#include <sys/stat.h>
#if defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#elif defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#endif
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

View file

@ -29,12 +29,6 @@
#include <stdint.h>
#include <string.h>
#if defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#elif defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#endif
#include "compiler/glsl/list.h"
#include "dev/intel_device_info.h"
#include "util/bitscan.h"