From: Marc-André Lureau Date: Thu, 24 Feb 2022 14:49:53 +0000 (+0400) Subject: Move HOST_LONG_BITS to compiler.h X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=519655970ebeb7a0dfe5ad3c1d1dc17a02b7faa6;p=qemu.git Move HOST_LONG_BITS to compiler.h This will help to make common code independent. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 0a5e67fb97..d9359859d4 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -7,6 +7,11 @@ #ifndef COMPILER_H #define COMPILER_H +#define HOST_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) + +/* HOST_LONG_BITS is the size of a native pointer in bits. */ +#define HOST_LONG_BITS (__SIZEOF_POINTER__ * 8) + #if defined __clang_analyzer__ || defined __COVERITY__ #define QEMU_STATIC_ANALYSIS 1 #endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 8b070dee21..9f06bf536f 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -244,9 +244,6 @@ extern "C" { #define TIME_MAX TYPE_MAXIMUM(time_t) #endif -/* HOST_LONG_BITS is the size of a native pointer in bits. */ -#define HOST_LONG_BITS (__SIZEOF_POINTER__ * 8) - /* Mac OSX has a bug that incorrectly defines SIZE_MAX with * the wrong type. Our replacement isn't usable in preprocessor * expressions, but it is sufficient for our needs. */