aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/types.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-01-12 16:45:39 +0100
committerJan Beulich <jbeulich@suse.com>2012-01-12 16:45:39 +0100
commitc7bd6f1e688a841b3c7e97893729452f04f770e4 (patch)
treea670fb212fd5c4d846cd9ba5f6e9a9f043900431 /xen/include/asm-x86/types.h
parentac2dc37213347371e2bd89b7d0c7b185d03845b1 (diff)
downloadxen-c7bd6f1e688a841b3c7e97893729452f04f770e4.tar.gz
xen-c7bd6f1e688a841b3c7e97893729452f04f770e4.tar.bz2
xen-c7bd6f1e688a841b3c7e97893729452f04f770e4.zip
x86: properly define size_t
Having it defined unilaterally as 'unsigned long' got me surprised recently when I tried to use the 'z' printk type modifier, as that is expected by the compiler to be used only on the type it knows size_t is supposed to have. Generally the compiler provides a construct to do this, so use it when available. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'xen/include/asm-x86/types.h')
-rw-r--r--xen/include/asm-x86/types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/xen/include/asm-x86/types.h b/xen/include/asm-x86/types.h
index b945da0932..1c4c5d584e 100644
--- a/xen/include/asm-x86/types.h
+++ b/xen/include/asm-x86/types.h
@@ -47,7 +47,13 @@ typedef unsigned long paddr_t;
#define PRIpaddr "016lx"
#endif
+#if defined(__SIZE_TYPE__)
+typedef __SIZE_TYPE__ size_t;
+#elif defined(__i386__)
+typedef unsigned int size_t;
+#else
typedef unsigned long size_t;
+#endif
typedef char bool_t;
#define test_and_set_bool(b) xchg(&(b), 1)