summaryrefslogtreecommitdiffstats
path: root/include/qemu/compiler.h
diff options
context:
space:
mode:
authorPeter Maydell2018-10-18 14:40:19 +0200
committerPeter Maydell2018-10-18 14:40:19 +0200
commit77f7c747193662edfadeeb3118d63eed0eac51a6 (patch)
tree960f45a3e014c2a73c266ce16bf34629f7a347bd /include/qemu/compiler.h
parentMerge remote-tracking branch 'remotes/rth/tags/pull-hppa-20181016' into staging (diff)
parentconfigure: remove glib_subprocess check (diff)
downloadqemu-77f7c747193662edfadeeb3118d63eed0eac51a6.tar.gz
qemu-77f7c747193662edfadeeb3118d63eed0eac51a6.tar.xz
qemu-77f7c747193662edfadeeb3118d63eed0eac51a6.zip
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2018-10-17' into staging
- Updates for qtest entries in test/Makefile.include - Simple updates for some shell scripts - Misc simple patches for files without regular subsystem pull requests # gpg: Signature made Wed 17 Oct 2018 08:20:35 BST # gpg: using RSA key 2ED9D774FE702DB5 # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" # gpg: aka "Thomas Huth <thuth@redhat.com>" # gpg: aka "Thomas Huth <huth@tuxfamily.org>" # gpg: aka "Thomas Huth <th.huth@posteo.de>" # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/huth-gitlab/tags/pull-request-2018-10-17: configure: remove glib_subprocess check hw/core/generic-loader: Compile only once, not for each target cpu: Provide a proper prototype for target_words_bigendian() in a header hw/core/generic-loader: Set a category for the generic-loader device qemu/compiler: Wrap __attribute__((flatten)) in a macro mailmap: Fix Reimar Döffinger name show-fixed-bugs.sh: Modern shell scripting (use $() instead of ``) git-submodule.sh: Modern shell scripting (use $() instead of ``) archive-source.sh: Modern shell scripting (use $() instead of ``) MAINTAINERS: update block/sheepdog maintainers gdbstub: Remove unused include tests: remove gcov-files- variables tests: Prevent more accidental test disabling target/cris/translate: Get rid of qemu_log_separate() qemu-common.h: update copyright date to 2018 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/compiler.h')
-rw-r--r--include/qemu/compiler.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index bf47e7bee4..66f8c241dc 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -131,6 +131,21 @@
#define HAS_ASSUME_ALIGNED
#endif
+#ifndef __has_attribute
+#define __has_attribute(x) 0 /* compatibility with older GCC */
+#endif
+
+/*
+ * GCC doesn't provide __has_attribute() until GCC 5, but we know all the GCC
+ * versions we support have the "flatten" attribute. Clang may not have the
+ * "flatten" attribute but always has __has_attribute() to check for it.
+ */
+#if __has_attribute(flatten) || !defined(__clang__)
+# define QEMU_FLATTEN __attribute__((flatten))
+#else
+# define QEMU_FLATTEN
+#endif
+
/* Implement C11 _Generic via GCC builtins. Example:
*
* QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x)