aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-03-31 17:43:18 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-03-31 17:43:18 +0100
commitefeb49b8138d9e5d97fda8ded0ce6b0dc21092ff (patch)
treea8a42db1ce90de1601f9f1ea82f44749e8a17ee0 /tools/include
parent0aa49ebc5e3f9061f5e9d2d94ec29a994f663493 (diff)
downloadxen-efeb49b8138d9e5d97fda8ded0ce6b0dc21092ff.tar.gz
xen-efeb49b8138d9e5d97fda8ded0ce6b0dc21092ff.tar.bz2
xen-efeb49b8138d9e5d97fda8ded0ce6b0dc21092ff.zip
Revert all usages of gcc's __extension__ keyword, and instead assert
that our headers are not built with __GNUC__ and __STRICT_ANSI__. __extension__ had some weird (and buggy) behaviours when nested which make it a risky proposition for general usage in our header files. Better to disallow -ansi, -std=c99, and similar gcc options when building against Xen headers. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/xen-foreign/mkchecker.py3
-rw-r--r--tools/include/xen-foreign/mkheader.py4
2 files changed, 2 insertions, 5 deletions
diff --git a/tools/include/xen-foreign/mkchecker.py b/tools/include/xen-foreign/mkchecker.py
index 264bf799b5..66c17b19e9 100644
--- a/tools/include/xen-foreign/mkchecker.py
+++ b/tools/include/xen-foreign/mkchecker.py
@@ -19,9 +19,6 @@ f.write('''
#include <stdlib.h>
#include <stddef.h>
#include <inttypes.h>
-
-#define __anonymous_struct __extension__ struct
-#define __anonymous_union __extension__ union
''');
for a in archs:
diff --git a/tools/include/xen-foreign/mkheader.py b/tools/include/xen-foreign/mkheader.py
index 17873e4842..8b249e3dfc 100644
--- a/tools/include/xen-foreign/mkheader.py
+++ b/tools/include/xen-foreign/mkheader.py
@@ -37,8 +37,8 @@ inttypes["x86_64"] = {
"xen_pfn_t" : "__align8__ uint64_t",
};
header["x86_64"] = """
-#ifdef __GNUC__
-# define __DECL_REG(name) __anonymous_union { uint64_t r ## name, e ## name; }
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+# define __DECL_REG(name) union { uint64_t r ## name, e ## name; }
# define __align8__ __attribute__((aligned (8)))
#else
# define __DECL_REG(name) uint64_t r ## name