aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-12-14 10:19:47 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-12-14 10:19:47 +0000
commit0f98c9945899c5dfacd5a410ff04178eda605a16 (patch)
tree6e10f904c562bd79adc2c1aacf7b5cbf2e7b1f35 /include
parentd8d5fefd8657d4f7b380b3a1533340434b5b9def (diff)
parent2b4c1125ac3db2734222ff43c25388a16aca4a99 (diff)
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2018-12-12' into staging
- Explicitly check for minimum compiler versions - Remove obsolete code for old compilers that is now not required anymore - Fix a duplicated typedef for Clang 3.4 # gpg: Signature made Wed 12 Dec 2018 09:05:50 GMT # 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-12-12: i2c: Move typedef of bitbang_i2c_interface to i2c.h Remove QEMU_ARTIFICIAL macro includes: Replace QEMU_GNUC_PREREQ with "__has_builtin || !defined(__clang__)" audio/alsaaudio: Remove compiler check around pragma tcg/tcg.h: Remove GCC check for tcg_debug_assert() macro configure: Remove old -fno-gcse workaround for GCC 4.6.x and 4.7.[012] configure: Remove obsolete check for Clang < 3.2 configure: Add a test for the minimum compiler version Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/i2c/i2c.h2
-rw-r--r--include/hw/i2c/ppc4xx_i2c.h3
-rw-r--r--include/qemu/compiler.h8
-rw-r--r--include/qemu/host-utils.h4
4 files changed, 5 insertions, 12 deletions
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index 5dc166158b..cf4c45a98f 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -82,6 +82,8 @@ int i2c_recv(I2CBus *bus);
DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
+typedef struct bitbang_i2c_interface bitbang_i2c_interface;
+
/* lm832x.c */
void lm832x_key_event(DeviceState *dev, int key, int state);
diff --git a/include/hw/i2c/ppc4xx_i2c.h b/include/hw/i2c/ppc4xx_i2c.h
index 0891a9c948..b3450bacf7 100644
--- a/include/hw/i2c/ppc4xx_i2c.h
+++ b/include/hw/i2c/ppc4xx_i2c.h
@@ -31,9 +31,6 @@
#include "hw/sysbus.h"
#include "hw/i2c/i2c.h"
-/* from hw/i2c/bitbang_i2c.h */
-typedef struct bitbang_i2c_interface bitbang_i2c_interface;
-
#define TYPE_PPC4xx_I2C "ppc4xx-i2c"
#define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2C)
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 6b92710487..261842beae 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -28,12 +28,6 @@
#define QEMU_SENTINEL __attribute__((sentinel))
-#if QEMU_GNUC_PREREQ(4, 3)
-#define QEMU_ARTIFICIAL __attribute__((always_inline, artificial))
-#else
-#define QEMU_ARTIFICIAL
-#endif
-
#if defined(_WIN32)
# define QEMU_PACKED __attribute__((gcc_struct, packed))
#else
@@ -127,7 +121,7 @@
#define __has_builtin(x) 0 /* compatibility with non-clang compilers */
#endif
-#if __has_builtin(__builtin_assume_aligned) || QEMU_GNUC_PREREQ(4, 7)
+#if __has_builtin(__builtin_assume_aligned) || !defined(__clang__)
#define HAS_ASSUME_ALIGNED
#endif
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 38da849be9..4cd170e6cd 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -207,7 +207,7 @@ static inline int cto64(uint64_t val)
*/
static inline int clrsb32(uint32_t val)
{
-#if QEMU_GNUC_PREREQ(4, 7)
+#if __has_builtin(__builtin_clrsb) || !defined(__clang__)
return __builtin_clrsb(val);
#else
return clz32(val ^ ((int32_t)val >> 1)) - 1;
@@ -223,7 +223,7 @@ static inline int clrsb32(uint32_t val)
*/
static inline int clrsb64(uint64_t val)
{
-#if QEMU_GNUC_PREREQ(4, 7)
+#if __has_builtin(__builtin_clrsbll) || !defined(__clang__)
return __builtin_clrsbll(val);
#else
return clz64(val ^ ((int64_t)val >> 1)) - 1;