Skip to content

Commit

Permalink
OpenAmp Middleware: fix C++ specific compilation error
Browse files Browse the repository at this point in the history
See STMicroelectronics/STM32CubeMP1#7
The header files including must be outside of the extern "C" { statement.
To be able to be included from C++ code
  • Loading branch information
ABOSTM committed Dec 3, 2021
1 parent bdf2b21 commit 07e7ed5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions system/Middlewares/OpenAMP/libmetal/lib/include/metal/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
#ifndef __METAL_MUTEX__H__
#define __METAL_MUTEX__H__

#ifdef METAL_FREERTOS
#include <metal/system/freertos/mutex.h>
#else
#include <metal/system/generic/mutex.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -20,12 +26,6 @@ extern "C" {
* @{
*/

#ifdef METAL_FREERTOS
#include <metal/system/freertos/mutex.h>
#else
#include <metal/system/generic/mutex.h>
#endif

/**
* @brief Initialize a libmetal mutex.
* @param[in] mutex Mutex to initialize.
Expand Down
5 changes: 2 additions & 3 deletions system/Middlewares/OpenAMP/virtual_driver/virt_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
#ifndef __VIRT_UART_H
#define __VIRT_UART_H

/* Includes ------------------------------------------------------------------*/
#include "openamp.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "openamp.h"

/* Exported structures --------------------------------------------------------*/
typedef struct __VIRT_UART_HandleTypeDef
{
Expand Down

0 comments on commit 07e7ed5

Please sign in to comment.