From: varinder.p Date: Wed, 18 May 2022 05:53:42 +0000 (+0530) Subject: Fixed C++ conflicts with qemu headers X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15fae976b5092beb24ce7baa4971b195e49a8570;p=sdk%2Femulator%2Fqemu.git Fixed C++ conflicts with qemu headers Change-Id: Id191c18ab77afddbedc442192b5e9cdef0667458 Signed-off-by: varinder.p --- diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index ff72db5115..e24cf0bc2a 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -209,7 +209,7 @@ #define atomic_fetch_inc(ptr) __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST) #define atomic_fetch_dec(ptr) __atomic_fetch_sub(ptr, 1, __ATOMIC_SEQ_CST) -#ifndef atomic_fetch_add +#ifndef __cplusplus #define atomic_fetch_add(ptr, n) __atomic_fetch_add(ptr, n, __ATOMIC_SEQ_CST) #define atomic_fetch_sub(ptr, n) __atomic_fetch_sub(ptr, n, __ATOMIC_SEQ_CST) #define atomic_fetch_and(ptr, n) __atomic_fetch_and(ptr, n, __ATOMIC_SEQ_CST) @@ -396,7 +396,7 @@ #define atomic_fetch_inc(ptr) __sync_fetch_and_add(ptr, 1) #define atomic_fetch_dec(ptr) __sync_fetch_and_add(ptr, -1) -#ifndef atomic_fetch_add +#ifndef __cplusplus #define atomic_fetch_add(ptr, n) __sync_fetch_and_add(ptr, n) #define atomic_fetch_sub(ptr, n) __sync_fetch_and_sub(ptr, n) #define atomic_fetch_and(ptr, n) __sync_fetch_and_and(ptr, n) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c76281f354..6a2ba1af40 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -89,7 +89,7 @@ * supported; otherwise, it will be omitted from the compiler error * message (but as it remains present in the source code, it can still * be useful when debugging). */ -#if defined(CONFIG_STATIC_ASSERT) +#if defined(CONFIG_STATIC_ASSERT) && !defined(__cplusplus) #define QEMU_BUILD_BUG_MSG(x, msg) _Static_assert(!(x), msg) #elif defined(__COUNTER__) #define QEMU_BUILD_BUG_MSG(x, msg) typedef QEMU_BUILD_BUG_ON_STRUCT(x) \ diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index e0bd8d6c27..81c03758ab 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -210,7 +210,6 @@ CONFIGURE_APPEND=" --extra-cflags=-Wno-error=logical-not-parentheses --extra-cflags=-Wno-error=strict-prototypes --extra-ldflags=-Wl,-rpath,'@executable_path' - --extra-ldflags=-Wl,-no_weak_imports --audio-drv-list=coreaudio --enable-cocoa --enable-hax diff --git a/tizen/src/ui/displayglwidget.cpp b/tizen/src/ui/displayglwidget.cpp index aeded3e09d..5cfcf727ca 100644 --- a/tizen/src/ui/displayglwidget.cpp +++ b/tizen/src/ui/displayglwidget.cpp @@ -33,8 +33,6 @@ extern "C" { #define QObject qemu_QObject #define QList qemu_QList #define bind qemu_bind -//declare _Static_assert as there is none for cpp file in qemu -#define _Static_assert(x , msg) //Q_ASSERT_X(x , "tizen/ui/displayglwidget.o", msg) #include "qemu/osdep.h" #include "qemu/thread.h" #undef QObject diff --git a/tizen/src/util/osutil-darwin.c b/tizen/src/util/osutil-darwin.c index c797ca8df0..c5bbe971d8 100644 --- a/tizen/src/util/osutil-darwin.c +++ b/tizen/src/util/osutil-darwin.c @@ -32,6 +32,7 @@ @brief Collection of utilities for darwin */ +#include "qemu/osdep.h" #include #include