10 lines
338 B
C
10 lines
338 B
C
#pragma once
|
|
|
|
#ifndef ARRAY_SIZE
|
|
//#ifdef __cplusplus
|
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
|
//#else
|
|
//#define ARRAY_SIZE_TYPE_CHECK(a) (sizeof(typeof(int[1 - 2 * !!__builtin_types_compatible_p(typeof(a), typeof(&a[0]))])))
|
|
//#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + ARRAY_SIZE_TYPE_CHECK(a) * 0)
|
|
//#endif
|
|
#endif |