Skip to contentSkip to conversation

include <sys/sysmacros.h> directly for major() and minor()

PATCH:libdrm Alan Coopersmith 2 participants 6 messages Jul 7, 2015 – Jul 8, 2015

lore
Share & tools
lore
#0 lore raw

Linux seems to pick this up via another header, but Solaris needs it explictly included, or we get undefined symbol errors for major & minor.

---
 libkms/linux.c |    1 +
 1 file changed, 1 insertion(+)
libkms/linux.c +1 -0
index 4d47148..f1767c8 100644
@@ -40,6 +40,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 
 #include "libdrm_macros.h"
 #include "internal.h"
Signature · 6 lines
1.7.9.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi Alan

Quoted 3 lines · Alan Coopersmith

Linux seems to pick this up via another header, but Solaris needs it explictly included, or we get undefined symbol errors for major & minor.

A slightly pedandic suggestion:
Can we use sys/types.h + sys/mkdev.h as the manpage suggests. We already do so in xf86drm.c

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

#2 lore raw
Quoted 9 lines · Emil Velikov

Hi Alan

Quoted 3 lines · Alan Coopersmith

Linux seems to pick this up via another header, but Solaris needs it explictly included, or we get undefined symbol errors for major & minor.

A slightly pedandic suggestion:
Can we use sys/types.h + sys/mkdev.h as the manpage suggests. We already do so in xf86drm.c

Sure - I'd thought sysmacros.h was mentioned in a manpage, but can't find that now. It builds fine with those instead, so v2 patch follows.

Signature · 6 lines
	-Alan Coopersmith-              [email protected]
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

[PATCH:libdrm] include <sys/types.h> & <sys/mkdev.h> directly for major() and minor()

Linux seems to pick these up via another header, but Solaris needs them explictly included, or we get undefined symbol errors for major & minor.

v2: use headers documented in makedev(3C) man page instead of sysmacros.h

---
 libkms/linux.c |    2 ++
 1 file changed, 2 insertions(+)
libkms/linux.c +2 -0
index 4d47148..53e03c3 100644
@@ -40,6 +40,8 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/mkdev.h>
 
 #include "libdrm_macros.h"
 #include "internal.h"
Signature · 6 lines
1.7.9.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH:libdrm] include <sys/types.h> & <sys/mkdev.h> directly for major() and minor()

Quoted 15 lines · Alan Coopersmith

Linux seems to pick these up via another header, but Solaris needs them explictly included, or we get undefined symbol errors for major & minor.

v2: use headers documented in makedev(3C) man page instead of sysmacros.h

---
 libkms/linux.c |    2 ++
 1 file changed, 2 insertions(+)
libkms/linux.c +0 -0
index 4d47148..53e03c3 100644

libkms/linux.c line 44

Quoted 5 lines
libkms/linux.c +2 -0
@@ -40,6 +40,8 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/mkdev.h>

I'll add the HAVE_SYS_MKDEV_H guard around the latter, and push this in the next few days. Unless someone objects that is ;-)

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

#5 lore raw

Re: [PATCH:libdrm] include <sys/types.h> & <sys/mkdev.h> directly for major() and minor()

Quoted 11 lines · Emil Velikov
Quoted 10 lines · Alan Coopersmith

Linux seems to pick these up via another header, but Solaris needs them explictly included, or we get undefined symbol errors for major & minor.

v2: use headers documented in makedev(3C) man page instead of sysmacros.h

---
  libkms/linux.c |    2 ++
  1 file changed, 2 insertions(+)
Quoted 12 lines

libkms/linux.c line 44

Quoted 10 lines
libkms/linux.c +2 -0
index 4d47148..53e03c3 100644
@@ -40,6 +40,8 @@
  #include <string.h>
  #include <unistd.h>
  #include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/mkdev.h>

I'll add the HAVE_SYS_MKDEV_H guard around the latter, and push this in the next few days. Unless someone objects that is ;-)

Oh, whoops, I forgot to check if there was a guard needed - that sounds great to me, thanks.

Signature · 6 lines
	-Alan Coopersmith-              [email protected]
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel