From 0b48d5978e4d7173eb7e9932b93234aeb3f2283a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Pan=C3=AD=C4=8Dek?= <693432+adrianpanicek@users.noreply.github.com> Date: Thu, 9 Nov 2017 22:46:38 +0100 Subject: [PATCH] ringbuf.h: Add anti name-mangling definition 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 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/components/freertos/include/freertos/ringbuf.h b/components/freertos/include/freertos/ringbuf.h index 93ba30758e..362381ab60 100644 --- a/components/freertos/include/freertos/ringbuf.h +++ b/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 */ +