]> granicus.if.org Git - esp-idf/commitdiff
ringbuf.h: Add anti name-mangling definition
authorAdrián Paníček <693432+adrianpanicek@users.noreply.github.com>
Thu, 9 Nov 2017 21:46:38 +0000 (22:46 +0100)
committerAngus Gratton <gus@projectgus.com>
Tue, 21 Nov 2017 23:08:15 +0000 (10:08 +1100)
When using CPP and C combination this particular file threw error on linking.

Merges https://github.com/espressif/esp-idf/pull/1249

(Amended to add INC_FREERTOS_H guard, comment on #endif)

components/freertos/include/freertos/ringbuf.h

index 93ba30758e79311cfbb923edcf93804fcbb29a2f..362381ab60a8b13665bc2065c1defd6af3e877b3 100644 (file)
@@ -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 */
+