Skip to content

Commit 72546d9

Browse files
authored
Merge pull request #7 from espressif/fix/cpp_include
fix(include): Make the headers includable from C++
2 parents fb08530 + d7e68bc commit 72546d9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

include/esp-stub-lib/flash.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ typedef struct stub_flash_info {
1818
uint32_t encrypted;
1919
} stub_lib_flash_info_t;
2020

21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif // __cplusplus
24+
2125
void stub_lib_flash_init(void **state);
2226
void stub_lib_flash_deinit(const void *state);
2327
void stub_lib_flash_get_info(stub_lib_flash_info_t *info);
@@ -27,3 +31,7 @@ int stub_lib_flash_erase_area(uint32_t addr, uint32_t size);
2731
int stub_lib_flash_erase_sector(uint32_t addr);
2832
int stub_lib_flash_erase_block(uint32_t addr);
2933
int stub_lib_flash_erase_chip(void);
34+
35+
#ifdef __cplusplus
36+
}
37+
#endif // __cplusplus

include/esp-stub-lib/log.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,13 @@
88

99
#include <stdint.h>
1010

11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif // __cplusplus
14+
1115
void stub_lib_log_init(uint8_t uart_num, uint32_t baudrate);
1216
void stub_lib_log_printf(const char *fmt, ...);
17+
18+
#ifdef __cplusplus
19+
}
20+
#endif // __cplusplus

0 commit comments

Comments
 (0)