summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2008-11-23 12:43:37 +0000
committerderaadt <deraadt@openbsd.org>2008-11-23 12:43:37 +0000
commit8cedcb41176a4d3a09fbaaf9bac3ae38ba20e989 (patch)
tree2f11e1d88bbf42e50cddb4f8a14a8738952b829e
parentUse file input parameter as default device output and file output parameters (diff)
downloadwireguard-openbsd-8cedcb41176a4d3a09fbaaf9bac3ae38ba20e989.tar.xz
wireguard-openbsd-8cedcb41176a4d3a09fbaaf9bac3ae38ba20e989.zip
this adds:
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) in the kernel, you can now use this instead of torturing yourself. ok dlg, well, really i just finally gave in to his arguments and we choose a better name than sizeofa().
-rw-r--r--sys/sys/param.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 9cc9eb7d2cd..2a743dd0a9a 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.78 2008/10/18 12:11:30 kettenis Exp $ */
+/* $OpenBSD: param.h,v 1.79 2008/11/23 12:43:37 deraadt Exp $ */
/* $NetBSD: param.h,v 1.23 1996/03/17 01:02:29 thorpej Exp $ */
/*-
@@ -197,6 +197,8 @@
#define offsetof(s, e) ((size_t)&((s *)0)->e)
#endif
+#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
+
/*
* Constants for setting the parameters of the kernel memory allocator.
*