summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarc-André Lureau2022-02-24 15:48:11 +0100
committerMarc-André Lureau2022-03-22 11:40:51 +0100
commit77a19c6aa405e0d734faf60d77a5d293fa4716ca (patch)
treeb4ce817725fae7acf9ed6402a9c74545bb538ef8 /include
parentcompiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED (diff)
downloadqemu-77a19c6aa405e0d734faf60d77a5d293fa4716ca.tar.gz
qemu-77a19c6aa405e0d734faf60d77a5d293fa4716ca.tar.xz
qemu-77a19c6aa405e0d734faf60d77a5d293fa4716ca.zip
Simplify HOST_LONG_BITS
Simplify the macro, not depending on headers defines, but compiler predefined __SIZEOF__POINTER__ only. Available since gcc 4.3 and clang 2.8. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/osdep.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index f2274b24cb..8b070dee21 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -245,13 +245,7 @@ extern "C" {
#endif
/* HOST_LONG_BITS is the size of a native pointer in bits. */
-#if UINTPTR_MAX == UINT32_MAX
-# define HOST_LONG_BITS 32
-#elif UINTPTR_MAX == UINT64_MAX
-# define HOST_LONG_BITS 64
-#else
-# error Unknown pointer size
-#endif
+#define HOST_LONG_BITS (__SIZEOF_POINTER__ * 8)
/* Mac OSX has a <stdint.h> bug that incorrectly defines SIZE_MAX with
* the wrong type. Our replacement isn't usable in preprocessor