[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#221543: linux-kernel-headers: #include <sys/pci.h> fails to compile



Package: linux-kernel-headers
Version: 2.5.999-test7-bk-9
Severity: important
Tags: patch

$ cat pci.c
#include <sys/pci.h>

$ gcc -c pci.c
In file included from /usr/include/linux/pci.h:20,
                 from /usr/include/sys/pci.h:23,
                 from pci.c:1:
/usr/include/linux/mod_devicetable.h:18: error: syntax error before "__u32"
/usr/include/linux/mod_devicetable.h:20: error: syntax error before "class"
/usr/include/linux/mod_devicetable.h:21: error: syntax error before "driver_data
"
/usr/include/linux/mod_devicetable.h:31: error: syntax error before "__u32"
/usr/include/linux/mod_devicetable.h:33: error: syntax error before "model_id"
/usr/include/linux/mod_devicetable.h:34: error: syntax error before "specifier_i
d"
/usr/include/linux/mod_devicetable.h:35: error: syntax error before "version"
/usr/include/linux/mod_devicetable.h:36: error: syntax error before "driver_data
"
/usr/include/linux/mod_devicetable.h:99: error: syntax error before "__u16"
/usr/include/linux/mod_devicetable.h:103: error: syntax error before "idProduct"
/usr/include/linux/mod_devicetable.h:104: error: syntax error before "bcdDevice_
lo"
/usr/include/linux/mod_devicetable.h:105: error: syntax error before "bcdDevice_
hi"
/usr/include/linux/mod_devicetable.h:108: error: syntax error before "bDeviceCla
ss"
/usr/include/linux/mod_devicetable.h:109: error: syntax error before "bDeviceSub
Class"
/usr/include/linux/mod_devicetable.h:110: error: syntax error before "bDevicePro
tocol"
/usr/include/linux/mod_devicetable.h:113: error: syntax error before "bInterface
Class"
/usr/include/linux/mod_devicetable.h:114: error: syntax error before "bInterface
SubClass"
/usr/include/linux/mod_devicetable.h:115: error: syntax error before "bInterface
Protocol"
/usr/include/linux/mod_devicetable.h:118: error: syntax error before "driver_inf
o"
/usr/include/linux/mod_devicetable.h:135: error: syntax error before "__u16"
/usr/include/linux/mod_devicetable.h:138: error: syntax error before "dev_type"
/usr/include/linux/mod_devicetable.h:139: error: syntax error before "cu_model"
/usr/include/linux/mod_devicetable.h:140: error: syntax error before "dev_model"
/usr/include/linux/mod_devicetable.h:142: error: syntax error before "driver_inf
o"

obviously mod_devicetable.h doesn't know __u32 and so on.

here's a workaround, maybe a cleaner fix is possible: polluting the
namespace with kernel_ulong_t doesn't look right.

perhaps much more needs to be #ifdef __KERNEL__

--- /usr/include/linux/mod_devicetable.h~       2003-10-15 16:15:01.000000000 +0100
+++ /usr/include/linux/mod_devicetable.h        2003-11-18 22:34:59.000000000 +0000
@@ -7,10 +7,8 @@
 #ifndef LINUX_MOD_DEVICETABLE_H
 #define LINUX_MOD_DEVICETABLE_H
 
-#ifdef __KERNEL__
 #include <linux/types.h>
 typedef unsigned long kernel_ulong_t;
-#endif
 
 #define PCI_ANY_ID (~0)
 


-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux enbeo 2.6.0-test9 #2 Sun Nov 16 00:13:17 GMT 2003 i586
Locale: LANG=C, LC_CTYPE=en_GB




Reply to: