zink: put sysmacros.h include under #ifdef MAJOR_IN_SYSMACROS

Fixes the build on OpenBSD, where major() is in sys/types and
sys/sysmacros.h does not exist.  Also include sys/mkdev.h if
MAJOR_IN_MKDEV is defined.

Fixes: 6d60115be7 ("zink: Fix enumerate devices when running compositor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26735>
(cherry picked from commit 33eecafe75)
This commit is contained in:
Jonathan Gray 2023-12-18 22:03:23 +11:00 committed by Eric Engestrom
parent c47c264f4d
commit f03eab9efc
2 changed files with 6 additions and 1 deletions

View file

@ -34,7 +34,7 @@
"description": "zink: put sysmacros.h include under #ifdef MAJOR_IN_SYSMACROS", "description": "zink: put sysmacros.h include under #ifdef MAJOR_IN_SYSMACROS",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": "6d60115be7cce87402f15ba01d81783dbf25f80a", "because_sha": "6d60115be7cce87402f15ba01d81783dbf25f80a",
"notes": null "notes": null

View file

@ -55,8 +55,13 @@
#include <xf86drm.h> #include <xf86drm.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h> #include <sys/sysmacros.h>
#endif #endif
#endif
static int num_screens = 0; static int num_screens = 0;
bool zink_tracing = false; bool zink_tracing = false;