btstack_defines: add ARRAYSIZE macro

This commit is contained in:
Matthias Ringwald 2024-09-30 13:53:59 +02:00
parent bdbfbe1cea
commit e84248e591

View File

@ -52,6 +52,12 @@
#define UNUSED(x) (void)(x) #define UNUSED(x) (void)(x)
#endif #endif
// Get the number of entries in an array ('x' must NOT be a pointer!)
#ifndef ARRAYSIZE
#define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0]))
#endif
// TYPES // TYPES
// packet handler // packet handler