From 3a9fc4f0bb3fd67e82cfccedfc396b5dbc749627 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Fri, 2 Dec 2016 18:09:37 +0900 Subject: [PATCH] build: enhance compiler compatibility Some built-in functions are depend on compiler version. So we exclude those functions when the source compiled by c++ compiler. Change-Id: I3a89552fc56c32b79e6c92f6a7c2e26ad2297233 Signed-off-by: SeokYeon Hwang --- include/qemu/atomic.h | 6 +++--- tizen/src/ui/displayglwidget.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 43b06458f1..c2aa6139e3 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -18,6 +18,9 @@ /* Compiler barrier */ #define barrier() ({ asm volatile("" ::: "memory"); (void)0; }) +#if defined(__ATOMIC_RELAXED) && !defined(__cplusplus) +/* For C11 atomic ops */ + /* The variable that receives the old value of an atomically-accessed * variable must be non-qualified, because atomic builtins return values * through a pointer-type argument as in __atomic_load(&var, &old, MODEL). @@ -60,9 +63,6 @@ (unsigned short)1, \ (expr)+0)))))) -#ifdef __ATOMIC_RELAXED -/* For C11 atomic ops */ - /* Manual memory barriers * *__atomic_thread_fence does not include a compiler barrier; instead, diff --git a/tizen/src/ui/displayglwidget.h b/tizen/src/ui/displayglwidget.h index 2008fc793e..26cf7cf96a 100644 --- a/tizen/src/ui/displayglwidget.h +++ b/tizen/src/ui/displayglwidget.h @@ -39,6 +39,7 @@ #include extern "C" { +#include "qemu/compiler.h" #include "qemu/thread.h" // FIXME: move it to common header -- 2.34.1