Skip to contentSkip to conversation

On Solaris, #include <sys/mkdev.h> in xf86drm.c

PATCH:libdrm Alan Coopersmith 2 participants 2 messages Mar 7, 2015 – Mar 9, 2015

lore
Share & tools
lore
#0 lore raw

Needed for the definitions of major() & minor() used in drmGetNodeTypeFromFd() and makedev() used in drmOpenMinor()

---
 configure.ac |    2 ++
 xf86drm.c    |    3 +++
 2 files changed, 5 insertions(+)
configure.ac +2 -0
index 8afee83..bd39aa0 100644
@@ -42,6 +42,8 @@ AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
 AC_FUNC_ALLOCA
 
+AC_CHECK_HEADERS([sys/mkdev.h])
+
 # Initialize libtool
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
xf86drm.c +3 -0
index e117bc6..c901f8b 100644
@@ -50,6 +50,9 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <stdarg.h>
+#ifdef HAVE_SYS_MKDEV_H
+# include <sys/mkdev.h> /* defines major(), minor(), and makedev() on Solaris */
+#endif
 
 /* Not all systems have MAP_FAILED defined */
 #ifndef MAP_FAILED
Signature · 6 lines
1.7.9.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by
#1 lore raw
Quoted 3 lines · Alan Coopersmith

Needed for the definitions of major() & minor() used in drmGetNodeTypeFromFd() and makedev() used in drmOpenMinor()

On my linux box they are declared in #include <sys/types.h>, behind a _BSD_SOURCE guard.
That aside, patch looks great. Thanks.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel