Add function to count element in arrays.
This commit is contained in:
@@ -68,3 +68,6 @@ typedef unsigned int pgprot_t;
|
||||
/// Returns the alignment, in bytes, of the specified type.
|
||||
#define alignof(type) offsetof( \
|
||||
struct { char c; type member; }, member)
|
||||
|
||||
/// Counts the number of elements of an array.
|
||||
#define count_of(x) ((sizeof(x) / sizeof((x)[0])) / ((size_t)(!(sizeof(x) % sizeof((x)[0])))))
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#include "string.h"
|
||||
#include "math.h"
|
||||
|
||||
/// Counts the number of elements of an array.
|
||||
#define COUNT_OF(x) ((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x])))))
|
||||
|
||||
/// Attribute Controller index port.
|
||||
#define AC_INDEX 0x03C0
|
||||
/// Attribute Controller write port.
|
||||
|
||||
Reference in New Issue
Block a user