[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/12] Simplify HOST_LONG_BITS
From: |
marcandre . lureau |
Subject: |
[PATCH 07/12] Simplify HOST_LONG_BITS |
Date: |
Thu, 24 Feb 2022 22:36:56 +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>
---
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 74473867f3f6..cea7303c78a4 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -261,13 +261,7 @@ G_NORETURN extern void QEMU_ERROR("code path is reachable")
#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
- Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround, (continued)
- [PATCH 06/12] Replace config-time define HOST_WORDS_BIGENDIAN, marcandre . lureau, 2022/02/24
- [PATCH 09/12] scripts/modinfo-collect: remove unused/dead code, marcandre . lureau, 2022/02/24
- [PATCH 08/12] Move HOST_LONG_BITS to compiler.h, marcandre . lureau, 2022/02/24
- [PATCH 11/12] util: remove the net/net.h dependency, marcandre . lureau, 2022/02/24
- [PATCH 07/12] Simplify HOST_LONG_BITS,
marcandre . lureau <=
- [PATCH 10/12] util: remove needless includes, marcandre . lureau, 2022/02/24
- [PATCH 12/12] qapi: remove needless include, marcandre . lureau, 2022/02/24