From 06accaf8519fc0b3c5776aeade9a912a84cb20f3 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 31 May 2017 17:20:17 +0800 Subject: [PATCH] add C++ include guards to header files which are missing them Fixes https://github.com/espressif/esp-idf/issues/628 --- components/esp32/include/esp_dport_access.h | 8 ++++++++ components/esp32/include/esp_heap_alloc_caps.h | 9 ++++++++- components/esp32/include/esp_ipc.h | 7 +++++++ components/fatfs/src/esp_vfs_fat.h | 8 ++++++++ components/soc/esp32/include/soc/dport_access.h | 7 +++++++ 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/components/esp32/include/esp_dport_access.h b/components/esp32/include/esp_dport_access.h index 1dbdb08266..7e6f732473 100644 --- a/components/esp32/include/esp_dport_access.h +++ b/components/esp32/include/esp_dport_access.h @@ -15,6 +15,10 @@ #ifndef _ESP_DPORT_ACCESS_H_ #define _ESP_DPORT_ACCESS_H_ +#ifdef __cplusplus +extern "C" { +#endif + void esp_dport_access_stall_other_cpu_start(void); void esp_dport_access_stall_other_cpu_end(void); void esp_dport_access_int_init(void); @@ -27,4 +31,8 @@ void esp_dport_access_int_init(void); #define DPORT_STALL_OTHER_CPU_END() esp_dport_access_stall_other_cpu_end() #endif +#ifdef __cplusplus +} +#endif + #endif /* _ESP_DPORT_ACCESS_H_ */ diff --git a/components/esp32/include/esp_heap_alloc_caps.h b/components/esp32/include/esp_heap_alloc_caps.h index a0e40a7cdc..f4bf7c115e 100644 --- a/components/esp32/include/esp_heap_alloc_caps.h +++ b/components/esp32/include/esp_heap_alloc_caps.h @@ -14,6 +14,10 @@ #ifndef HEAP_ALLOC_CAPS_H #define HEAP_ALLOC_CAPS_H +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Flags to indicate the capabilities of the various memory systems */ @@ -99,5 +103,8 @@ static inline bool esp_ptr_dma_capable( const void *ptr ) return ( (int)ptr >= 0x3FFAE000 && (int)ptr < 0x40000000 ); } +#ifdef __cplusplus +} +#endif -#endif \ No newline at end of file +#endif //HEAP_ALLOC_CAPS_H diff --git a/components/esp32/include/esp_ipc.h b/components/esp32/include/esp_ipc.h index a77b4932fe..7759e49d9d 100644 --- a/components/esp32/include/esp_ipc.h +++ b/components/esp32/include/esp_ipc.h @@ -17,6 +17,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef void (*esp_ipc_func_t)(void* arg); /** @@ -84,5 +88,8 @@ esp_err_t esp_ipc_call(uint32_t cpu_id, esp_ipc_func_t func, void* arg); esp_err_t esp_ipc_call_blocking(uint32_t cpu_id, esp_ipc_func_t func, void* arg); +#ifdef __cplusplus +} +#endif #endif /* __ESP_IPC_H__ */ diff --git a/components/fatfs/src/esp_vfs_fat.h b/components/fatfs/src/esp_vfs_fat.h index 140f8bdc32..1ce0b54d3f 100644 --- a/components/fatfs/src/esp_vfs_fat.h +++ b/components/fatfs/src/esp_vfs_fat.h @@ -21,6 +21,10 @@ #include "ff.h" #include "wear_levelling.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Register FATFS with VFS component * @@ -173,3 +177,7 @@ esp_err_t esp_vfs_fat_spiflash_mount(const char* base_path, * - ESP_ERR_INVALID_STATE if esp_vfs_fat_spiflash_mount hasn't been called */ esp_err_t esp_vfs_fat_spiflash_unmount(const char* base_path, wl_handle_t wl_handle); + +#ifdef __cplusplus +} +#endif diff --git a/components/soc/esp32/include/soc/dport_access.h b/components/soc/esp32/include/soc/dport_access.h index 6d3b6efc29..3fc1963490 100644 --- a/components/soc/esp32/include/soc/dport_access.h +++ b/components/soc/esp32/include/soc/dport_access.h @@ -19,6 +19,10 @@ #include "esp_attr.h" #include "esp_dport_access.h" +#ifdef __cplusplus +extern "C" { +#endif + //Registers Operation {{ //Register read macros with an underscore prefix access DPORT memory directly. In IDF apps, use the non-underscore versions to be SMP-safe. @@ -114,5 +118,8 @@ static inline uint32_t IRAM_ATTR DPORT_READ_PERI_REG(uint32_t addr) #define DPORT_GET_PERI_REG_BITS2(reg, mask,shift) ((DPORT_READ_PERI_REG(reg)>>(shift))&(mask)) //}} +#ifdef __cplusplus +} +#endif #endif /* _DPORT_ACCESS_H_ */