zink: put sysmacros.h include under #ifdef MAJOR_IN_SYSMACROS
authorJonathan Gray <jsg@jsg.id.au>
Mon, 18 Dec 2023 11:03:23 +0000 (22:03 +1100)
committerEric Engestrom <eric@engestrom.ch>
Wed, 3 Jan 2024 12:03:03 +0000 (12:03 +0000)
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: 6d60115be7c ("zink: Fix enumerate devices when running compositor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26735>
(cherry picked from commit 33eecafe757264ed58e33b87e010aacc6a376da8)

.pick_status.json
src/gallium/drivers/zink/zink_screen.c

index cb50a26..4f69762 100644 (file)
@@ -34,7 +34,7 @@
         "description": "zink: put sysmacros.h include under #ifdef MAJOR_IN_SYSMACROS",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "6d60115be7cce87402f15ba01d81783dbf25f80a",
         "notes": null
index f42f340..97af50f 100644 (file)
 #include <xf86drm.h>
 #include <fcntl.h>
 #include <sys/stat.h>
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
 #include <sys/sysmacros.h>
 #endif
+#endif
 
 static int num_screens = 0;
 bool zink_tracing = false;