summaryrefslogtreecommitdiff
path: root/src/nelem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nelem.h')
-rw-r--r--src/nelem.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nelem.h b/src/nelem.h
new file mode 100644
index 0000000..61bf6ce
--- /dev/null
+++ b/src/nelem.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2021 Philip Jones
+ *
+ * Licensed under the MIT License.
+ * See either the LICENSE file, or:
+ *
+ * https://opensource.org/licenses/MIT
+ *
+ */
+
+#ifndef N_ELEM
+#define N_ELEM(x) (sizeof(x) / sizeof(*(x)))
+#endif