[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/21] Move HOST_LONG_BITS to compiler.h
|
From: |
marcandre . lureau |
|
Subject: |
[PULL 09/21] Move HOST_LONG_BITS to compiler.h |
|
Date: |
Tue, 22 Mar 2022 16:25:49 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
This will help to make common code independent.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/qemu/compiler.h | 5 +++++
include/qemu/osdep.h | 3 ---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 0a5e67fb970e..d9359859d435 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 8b070dee21c4..9f06bf536fb1 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 <stdint.h> 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. */
--
2.35.1.273.ge6ebfd0e8cbb
- [PULL 00/21] Fixes patches, marcandre . lureau, 2022/03/22
- [PULL 01/21] qemu-options: define -spice only #ifdef CONFIG_SPICE, marcandre . lureau, 2022/03/22
- [PULL 02/21] vl: typo fix in a comment, marcandre . lureau, 2022/03/22
- [PULL 03/21] m68k/nios2-semi: fix gettimeofday() result check, marcandre . lureau, 2022/03/22
- [PULL 04/21] Drop qemu_foo() socket API wrapper, marcandre . lureau, 2022/03/22
- [PULL 09/21] Move HOST_LONG_BITS to compiler.h,
marcandre . lureau <=
- [PULL 05/21] Replace GCC_FMT_ATTR with G_GNUC_PRINTF, marcandre . lureau, 2022/03/22
- [PULL 07/21] compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED, marcandre . lureau, 2022/03/22
- [PULL 06/21] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT, marcandre . lureau, 2022/03/22
- [PULL 10/21] scripts/modinfo-collect: remove unused/dead code, marcandre . lureau, 2022/03/22
- [PULL 08/21] Simplify HOST_LONG_BITS, marcandre . lureau, 2022/03/22
- [PULL 11/21] util: remove needless includes, marcandre . lureau, 2022/03/22
- [PULL 12/21] util: remove the net/net.h dependency, marcandre . lureau, 2022/03/22
- [PULL 13/21] qapi: remove needless include, marcandre . lureau, 2022/03/22
- [PULL 14/21] meson: move int128 checks from configure, marcandre . lureau, 2022/03/22
- [PULL 15/21] meson: fix CONFIG_ATOMIC128 check, marcandre . lureau, 2022/03/22