path: root/hwaccess.h
diff options
authorCarl-Daniel Hailfinger <>2010-06-25 13:18:48 +0000
committerCarl-Daniel Hailfinger <>2010-06-25 13:18:48 +0000
commit7237683faff7d67a7caac9addb6ef5e6944db0b1 (patch)
treed67df6db6093d73939f07078ce1df6900456752c /hwaccess.h
parent2bd007a97e16487e2a2780eec63e148aaaad4c5c (diff)
Work around shadowing warnings in libpci headers
This is needed for warning-free compilation on older gcc versions (3.x and probably older). Such a gcc version is the default on i386 OpenBSD. Corresponding to flashrom svn r1061. Signed-off-by: Carl-Daniel Hailfinger <> Acked-by: Stuart Henderson <>
Diffstat (limited to 'hwaccess.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/hwaccess.h b/hwaccess.h
index 91366a6..53e908a 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -31,7 +31,14 @@
#if NEED_PCI == 1
+ * libpci headers use the variable name "index" which triggers shadowing
+ * warnings on systems which have the index() function in a default #include
+ * or as builtin.
+ */
+#define index shadow_workaround_index
#include <pci/pci.h>
+#undef index
#if defined (__i386__) || defined (__x86_64__)
OpenPOWER on IntegriCloud