]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Simplify HOST_LONG_BITS
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 24 Feb 2022 14:48:11 +0000 (18:48 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 22 Mar 2022 10:40:51 +0000 (14:40 +0400)
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

index f2274b24cbf566cb1b52e967eb1b0350eef99883..8b070dee21c4bd60c2cbebcd82b33a75c8bb3e42 100644 (file)
@@ -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