The header files including must be outside of the extern "C" { statement.
To be able to be included from C++ code.
Else such error can occur (reproduce on STM32MP1Cube distribution)
gcc/arm-none-eabi/include/c++/10.2.1/atomic:1467:3: error: template
with C linkage
1467 | template<typename _ITp>
| ^~~~~~~~
In file included from STM32CubeMP1/Middlewares/Third_Party/OpenAMP/
open-amp/lib/include/openamp/rpmsg.h:16,
from STM32CubeMP1/Middlewares/Third_Party/OpenAMP/
open-amp/lib/include/openamp/open_amp.h:11,
from empty_main.cpp:1:
STM32CubeMP1/Middlewares/Third_Party/OpenAMP/libmetal/lib/include/
metal/mutex.h:16:1: note: 'extern "C"' linkage
started here
16 | extern "C" {
| ^~~~~~~~~~
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
This change will save compilation time from looking into the directory
containing the current file for the header files.
Signed-off-by: Wendy Liang <jliang@xilinx.com>
We declare condition variable APIs in lib/condition.h
We declare the following APIs:
* metal_condition_init: condition variable dynamic initialization
* metal_condition_signal: signal one waiter
* metal_condition_broadcast: signal all the waiters
* metal_condition_wait: wait on the specified condition variable
Signed-off-by: Wendy Liang <jliang@xilinx.com>