From patchwork Wed Oct 3 21:11:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: qemu-barrier: Fix compiler version check for future gcc versions Date: Wed, 03 Oct 2012 11:11:02 -0000 From: Stefan Weil X-Patchwork-Id: 188930 Message-Id: <1349298662-16666-1-git-send-email-sw@weilnetz.de> To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Stefan Weil , qemu-stable@nongnu.org, "Michael S. Tsirkin" 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 --- With current gcc versions (gcc-4.x) there is no problem. Nevertheless, I suggest to fix this in stable versions, too. Regards Stefan Weil qemu-barrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-barrier.h b/qemu-barrier.h index 7e11197..16f0942 100644 --- a/qemu-barrier.h +++ b/qemu-barrier.h @@ -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")