build: enhance compiler compatibility
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 2 Dec 2016 09:09:37 +0000 (18:09 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 2 Dec 2016 09:12:58 +0000 (18:12 +0900)
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 <syeon.hwang@samsung.com>
include/qemu/atomic.h
tizen/src/ui/displayglwidget.h

index 43b0645..c2aa613 100644 (file)
@@ -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,
index 2008fc7..26cf7cf 100644 (file)
@@ -39,6 +39,7 @@
 #include <QMatrix4x4>
 
 extern "C" {
+#include "qemu/compiler.h"
 #include "qemu/thread.h"
 
 // FIXME: move it to common header