compiler.h include fix for usb-linux.c
PATCH 1/1 compiler.h include fix for usb-linux.c
Hi,
Redhat and its derivatives don't have /usr/include/linux/compiler.h But debian, opensuse etc. have compiler.h
Without including compiler.h in usb-linux.c build fails on opensuse.
So instead of removing compiler.h, its better to check if it is there on build host and if it is there then include it.
patch is made against qemu-snapshot-2007-01-10_05
Regards,
Ameya.
configure +3 -1
@@ -749,7 +749,9 @@ if [ "$build_docs" = "yes" ] ; then echo "BUILD_DOCS=yes" >> $config_mak fi - +if test -f "/usr/include/linux/compiler.h" ; then + echo "#define HAVE_COMPILER_H 1" >> $config_h +fi # XXX: suppress that if [ "$bsd" = "yes" ] ; then echo "#define O_LARGEFILE 0" >> $config_h
usb-linux.c +3 -0
@@ -24,6 +24,9 @@#include "vl.h" #if defined(__linux__) +#ifdef HAVE_COMPILER_H +#include <linux/compiler.h> +#endif #include <dirent.h> #include <sys/ioctl.h> #include <linux/usbdevice_fs.h>
Quoted 6 lines · ( ???????????? ?????????????????? ) Ameya Palande
Hi,
Redhat and its derivatives don't have
/usr/include/linux/compiler.hBut debian, opensuse etc. havecompiler.hWithout including
compiler.hinusb-linux.cbuild fails on opensuse.
JFTR, it works on debian.
Thiemo
Quoted 6 lines · Thiemo Seufer
Quoted 5 lines · ( ???????????? ?????????????????? ) Ameya Palande
Hi,
Redhat and its derivatives don't have
/usr/include/linux/compiler.hBut debian, opensuse etc. havecompiler.h
Quoted 7 lines
Quoted 1 line
Without including
compiler.hinusb-linux.cbuild fails on opensuse.JFTR, it works on debian.
Thiemo
It works on debian because on debian /usr/include/linux/usbdevice_fs.h file includes <linux/compiler.h>
Regards,
Ameya.
Quoted 9 lines · ( अमेय पाळंदे ) Ameya Palande
Quoted 8 lines · Thiemo Seufer
Quoted 6 lines · ( ???????????? ?????????????????? ) Ameya Palande
Hi,
Redhat and its derivatives don't have
/usr/include/linux/compiler.hBut debian, opensuse etc. havecompiler.hWithout including
compiler.hinusb-linux.cbuild fails on opensuse.
Quoted 8 lines
Quoted 5 lines
JFTR, it works on debian.
Thiemo
It works on debian because on debian
/usr/include/linux/usbdevice_fs.hfile includes <linux/compiler.h>
The issue before is that usb-linux.c should not be including linux/compiler.h. See the xen approach to fixing this for the broken distros:
http://xenbits2.xensource.com/xen-unstable.hg?rev/ba7487569374;style=rev
%3Dusb