summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-08-27 15:00:59 -0600
committerEric Blake <eblake@redhat.com>2012-08-27 15:08:25 -0600
commit0b4b53bb80085806918f217e5fbaf3c69599aac2 (patch)
tree70d69f7231dbdf30a8f5684055cba1eeff74a246 /src/util
parentqemu: Fix define logic (diff)
downloadlibvirt-0b4b53bb80085806918f217e5fbaf3c69599aac2.tar.gz
libvirt-0b4b53bb80085806918f217e5fbaf3c69599aac2.tar.bz2
libvirt-0b4b53bb80085806918f217e5fbaf3c69599aac2.zip
build: work with older libnl1 headers
Ubuntu 10.04 shipped with out-of-the-box libnl1 headers, which assumed the old gcc semantics of 'extern inline' as a C89 extension: the function will _always_ be inline if it is used, and that it may be declared extern inline in headers without a definition, as long as the definition occurs before any use. But when C99 added 'extern inline' as a mandatory feature of the language, with slightly different semantics than gcc (the function MUST have external linkage, and the inline definition MUST be present alongside any declaration, where the compiler can then choose which of the two versions to use), this rendered the use of 'inline' in libnl's header obsolete. Most distros already solved this by removing 'inline' (the resulting 'extern' is correct, regardless of gcc semantics), and libnl-3 does not have the problem (where it has switched to 'static inline' instead, again with the definition present, and again, our hack will result in plain 'static' with no ill effects). But for the case of building out of the box, we hack around the broken Ubuntu header. * src/util/virnetlink.h: Work around libnl issue.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/virnetlink.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
index 1982dae5b..82154de08 100644
--- a/src/util/virnetlink.h
+++ b/src/util/virnetlink.h
@@ -26,7 +26,11 @@
# if defined(__linux__) && defined(HAVE_LIBNL)
+/* Work around a bug where older libnl-1 headers expected older gcc
+ * semantics of 'extern inline' that conflict with C99 semantics. */
+# define inline
# include <netlink/msg.h>
+# undef inline
# else