Add function to count element in arrays.

This commit is contained in:
Enrico Fraccaroli (Galfurian)
2023-06-29 15:48:56 -04:00
parent d6c4dc3184
commit 3ed59b6f55
2 changed files with 3 additions and 3 deletions
+3
View File
@@ -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])))))
-3
View File
@@ -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.