]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qemu-barrier: Fix compiler version check for future gcc versions
authorStefan Weil <sw@weilnetz.de>
Wed, 3 Oct 2012 21:11:02 +0000 (23:11 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 5 Oct 2012 13:00:22 +0000 (08:00 -0500)
The current check will give a wrong result for gcc-5.x with x < 4.
Using QEMU_GNUC_PREREQ is simpler and fixes that issue.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-barrier.h

index 7e11197814e1e2de566f837d8c9cda409fd9f382..16f09429c3295676c9cd7a74ba1166fcc882a194 100644 (file)
@@ -19,7 +19,7 @@
  * mfence on 32 bit as well, e.g. if built with -march=pentium-m.
  * However, on i386, there seem to be known bugs as recently as 4.3.
  * */
-#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
+#if QEMU_GNUC_PREREQ(4, 4)
 #define smp_mb() __sync_synchronize()
 #else
 #define smp_mb() asm volatile("lock; addl $0,0(%%esp) " ::: "memory")