chiark / gitweb /
Provide ARRAY_SIZE
[secnet.git] / secnet.h
index 78dc676f4eb72f3180c03601e98917c8b79b6d9f..5c97751c9eedb97b0dd37af776adc1b409506541 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -574,6 +574,7 @@ extern void log_from_fd(int fd, cstring_t prefix, struct log_if *log);
 #define STRING(x) STRING2(x)
 
 #define FILLZERO(obj) (memset(&(obj),0,sizeof((obj))))
+#define ARRAY_SIZE(ary) (sizeof((ary))/sizeof((ary)[0]))
 
 /*
  * void COPY_OBJ(  OBJECT& dst, const OBJECT& src);