Explorar el Código

Merge branch 'bugfix/cpp_guards' into 'master'

Add C++ guards to freertos/ringbuf.h, heap headers

See merge request !1552

Ivan Grokhotkov hace 8 años
padre
commit
5fe91ae7cd

+ 13 - 1
components/freertos/include/freertos/ringbuf.h

@@ -1,6 +1,14 @@
 #ifndef FREERTOS_RINGBUF_H
 #define FREERTOS_RINGBUF_H
 
+#ifndef INC_FREERTOS_H
+	#error "include FreeRTOS.h" must appear in source files before "include ringbuf.h"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
 Header definitions for a FreeRTOS ringbuffer object
 
@@ -242,5 +250,9 @@ BaseType_t xRingbufferRemoveFromQueueSetWrite(RingbufHandle_t ringbuf, QueueSetH
  */
 void xRingbufferPrintInfo(RingbufHandle_t ringbuf);
 
-
+#ifdef __cplusplus
+}
 #endif
+
+#endif /* FREERTOS_RINGBUF_H */
+

+ 7 - 2
components/heap/include/esp_heap_caps_init.h

@@ -17,6 +17,10 @@
 #include "esp_heap_caps.h"
 #include "soc/soc_memory_layout.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @brief Initialize the capability-aware heap allocator.
  *
@@ -82,5 +86,6 @@ esp_err_t heap_caps_add_region(intptr_t start, intptr_t end);
 esp_err_t heap_caps_add_region_with_caps(const uint32_t caps[], intptr_t start, intptr_t end);
 
 
-
-
+#ifdef __cplusplus
+}
+#endif

+ 8 - 0
components/heap/include/esp_heap_trace.h

@@ -17,6 +17,10 @@
 #include <stdint.h>
 #include <esp_err.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if !defined(CONFIG_HEAP_TRACING) && !defined(HEAP_TRACE_SRCFILE)
 #warning "esp_heap_trace.h is included but heap tracing is disabled in menuconfig, functions are no-ops"
 #endif
@@ -134,3 +138,7 @@ esp_err_t heap_trace_get(size_t index, heap_trace_record_t *record);
  *
  */
 void heap_trace_dump(void);
+
+#ifdef __cplusplus
+}
+#endif