feat(utils.h add count_of): mq clean using count_of

This commit is contained in:
yangwei
2024-09-19 16:56:52 +08:00
parent 7b32a86e66
commit 6d36a2fc9f
2 changed files with 5 additions and 1 deletions

View File

@@ -35,6 +35,10 @@
(type *)( (char *)__mptr - offsetof(type,member) ); })
#endif
#ifndef count_of
#define count_of(x) (sizeof(x) / sizeof(0 [x]))
#endif
#ifndef likely
#define likely(x) __builtin_expect((x), 1)
#endif /* likely */