summaryrefslogtreecommitdiff
path: root/digital/ucoolib/ucoolib
diff options
context:
space:
mode:
Diffstat (limited to 'digital/ucoolib/ucoolib')
-rw-r--r--digital/ucoolib/ucoolib/common.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/digital/ucoolib/ucoolib/common.hh b/digital/ucoolib/ucoolib/common.hh
index 5be6227f..1f6d75ae 100644
--- a/digital/ucoolib/ucoolib/common.hh
+++ b/digital/ucoolib/ucoolib/common.hh
@@ -72,4 +72,7 @@ assert_perror (bool condition)
} // namespace ucoo
+/// Get array length at compile time, must be a macro until c++11.
+#define lengthof(array) (sizeof (array) / sizeof((array)[0]))
+
#endif // ucoolib_common_h