diff options
author | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-06-25 13:18:48 +0000 |
---|---|---|
committer | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2010-06-25 13:18:48 +0000 |
commit | bbb8ee367ac1141d6647df3247b2d83d4076d9bd (patch) | |
tree | d67df6db6093d73939f07078ce1df6900456752c | |
parent | 18e077c4f51707b382bf435d594199089efb00ce (diff) | |
download | flashrom-bbb8ee367ac1141d6647df3247b2d83d4076d9bd.tar.gz |
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.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stuart Henderson <sthen@openbsd.org>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1061 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | hwaccess.h | 7 |
2 files changed, 10 insertions, 1 deletions
@@ -310,7 +310,9 @@ compiler: featuresavailable ifeq ($(CHECK_LIBPCI), yes) pciutils: compiler @printf "Checking for libpci headers... " - @$(shell ( echo "#include <pci/pci.h>"; \ + @# Avoid a failing test due to libpci header symbol shadowing breakage + @$(shell ( echo "#define index shadow_workaround_index"; \ + echo "#include <pci/pci.h>"; \ echo "struct pci_access *pacc;"; \ echo "int main(int argc, char **argv)"; \ echo "{ pacc = pci_alloc(); return 0; }"; ) > .test.c ) @@ -31,7 +31,14 @@ #endif #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 #endif #if defined (__i386__) || defined (__x86_64__) |