mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
ringbuf: Fix ordering of StaticRingbuffer_t
When building on linux/host compilers (e.g., GCC), the compiler may add padding depending on the size and order of the member types. This commit fixes the ordering or the StaticRingbuffer_t such that it matches the internal Ringbuffer_t. The "_Static_assert" is always enabled for all compilers. Closes https://github.com/espressif/esp-idf/issues/11726
This commit is contained in:
@@ -73,9 +73,7 @@ typedef struct RingbufferDefinition {
|
||||
portMUX_TYPE mux; //Spinlock required for SMP
|
||||
} Ringbuffer_t;
|
||||
|
||||
#if __GNUC_PREREQ(4, 6)
|
||||
_Static_assert(sizeof(StaticRingbuffer_t) == sizeof(Ringbuffer_t), "StaticRingbuffer_t != Ringbuffer_t");
|
||||
#endif
|
||||
|
||||
// ------------------------------------------------ Forward Declares ---------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user