summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authoraurel322008-10-12 18:15:04 +0200
committeraurel322008-10-12 18:15:04 +0200
commitbad5b1ec8e5d2b68be2c0fd33db2094942e6b685 (patch)
tree02b7b8b596b9492f1b59872da2d41b445906bf6b /hw
parentOnly use __builtin_* with GCC >= 3.4 (diff)
downloadqemu-bad5b1ec8e5d2b68be2c0fd33db2094942e6b685.tar.gz
qemu-bad5b1ec8e5d2b68be2c0fd33db2094942e6b685.tar.xz
qemu-bad5b1ec8e5d2b68be2c0fd33db2094942e6b685.zip
Define macro QEMU_GNUC_PREREQ and use it
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5467 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/apic.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/apic.c b/hw/apic.c
index 42920869c1..762852e90f 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -20,6 +20,7 @@
#include "hw.h"
#include "pc.h"
#include "qemu-timer.h"
+#include "osdep.h"
//#define DEBUG_APIC
//#define DEBUG_IOAPIC
@@ -107,7 +108,7 @@ static void apic_update_irq(APICState *s);
/* Find first bit starting from msb */
static int fls_bit(uint32_t value)
{
-#if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#if QEMU_GNUC_PREREQ(3, 4)
return 31 - __builtin_clz(value);
#else
unsigned int ret = 0;
@@ -127,7 +128,7 @@ static int fls_bit(uint32_t value)
/* Find first bit starting from lsb */
static int ffs_bit(uint32_t value)
{
-#if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#if QEMU_GNUC_PREREQ(3, 4)
return __builtin_ffs(value) - 1;
#else
unsigned int ret = 0;