Skip to content

Commit 5e34298

Browse files
kaidegitRbb666
authored andcommitted
add missing extern "C" in header to support cpp
1 parent b3d5905 commit 5e34298

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Diff for: components/drivers/include/ipc/completion.h

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2024-04-28 Shell Add new wait_flags() & wakeup_by_errno() API
9+
* 2024-10-24 yekai Add C++ support
910
*/
1011
#ifndef COMPLETION_H_
1112
#define COMPLETION_H_
@@ -30,6 +31,10 @@ struct rt_completion
3031

3132
#define RT_COMPLETION_INIT(comp) {0}
3233

34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
3338
void rt_completion_init(struct rt_completion *completion);
3439
rt_err_t rt_completion_wait(struct rt_completion *completion,
3540
rt_int32_t timeout);
@@ -42,4 +47,9 @@ rt_err_t rt_completion_wait_flags_noisr(struct rt_completion *completion,
4247
void rt_completion_done(struct rt_completion *completion);
4348
rt_err_t rt_completion_wakeup(struct rt_completion *completion);
4449
rt_err_t rt_completion_wakeup_by_errno(struct rt_completion *completion, rt_err_t error);
50+
51+
#ifdef __cplusplus
52+
}
53+
#endif
54+
4555
#endif

Diff for: components/drivers/spi/dev_spi_flash_sfud.h

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2016-09-28 armink first version.
9+
* 2024-10-24 yekai Add C++ support
910
*/
1011

1112
#ifndef __DEV_SPI_FLASH_SFUD_H__
@@ -16,6 +17,10 @@
1617
#include "./sfud/inc/sfud.h"
1718
#include "dev_spi_flash.h"
1819

20+
#ifdef __cplusplus
21+
extern "C" {
22+
#endif
23+
1924
/**
2025
* Probe SPI flash by SFUD(Serial Flash Universal Driver) driver library and though SPI device.
2126
*
@@ -66,4 +71,8 @@ sfud_flash_t rt_sfud_flash_find(const char *spi_dev_name);
6671
*/
6772
sfud_flash_t rt_sfud_flash_find_by_dev_name(const char *flash_dev_name);
6873

74+
#ifdef __cplusplus
75+
}
76+
#endif
77+
6978
#endif /* __DEV_SPI_FLASH_SFUD_H__ */

0 commit comments

Comments
 (0)