[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/27] Simplify HOST_LONG_BITS
From: |
marcandre . lureau |
Subject: |
[PATCH 12/27] Simplify HOST_LONG_BITS |
Date: |
Wed, 16 Mar 2022 13:53:21 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
include/qemu/osdep.h | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 7175ee53a217..de0c0ab02f4d 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -251,13 +251,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
--
2.35.1.273.ge6ebfd0e8cbb
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 12/27] Simplify HOST_LONG_BITS,
marcandre . lureau <=