diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-07-08 11:48:21 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-07-08 11:48:21 +0000 |
commit | 915ed2205c0dd0458c433815cba83b22306dce47 (patch) | |
tree | b9eed211d84bd10669ab4b7b5de9623b7c09a168 /sbin | |
parent | 12e40267e6c681fb7cb06dfbc555ac47ccf2ec3d (diff) |
if you use nitems() in userland, you must define it yourself
discussed with guenther
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/iked/types.h | 6 | ||||
-rw-r--r-- | sbin/newfs_ext2fs/extern.h | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sbin/iked/types.h b/sbin/iked/types.h index ec4da810c03..eda50b79d3d 100644 --- a/sbin/iked/types.h +++ b/sbin/iked/types.h @@ -1,4 +1,4 @@ -/* $OpenBSD: types.h,v 1.10 2011/05/05 12:17:10 reyk Exp $ */ +/* $OpenBSD: types.h,v 1.11 2012/07/08 11:48:20 deraadt Exp $ */ /* $vantronix: types.h,v 1.24 2010/05/11 12:05:56 reyk Exp $ */ /* @@ -126,4 +126,8 @@ enum flushmode { RESET_USER }; +#ifndef nitems +#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif + #endif /* _IKED_TYPES_H */ diff --git a/sbin/newfs_ext2fs/extern.h b/sbin/newfs_ext2fs/extern.h index 7613f1bc8a1..be60560acfd 100644 --- a/sbin/newfs_ext2fs/extern.h +++ b/sbin/newfs_ext2fs/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.2 2010/02/16 12:25:35 otto Exp $ */ +/* $OpenBSD: extern.h,v 1.3 2012/07/08 11:48:20 deraadt Exp $ */ /* $NetBSD: extern.h,v 1.4 2009/10/21 01:07:46 snj Exp $ */ /* @@ -29,6 +29,10 @@ #define EXT2_LOG_MAXBSIZE 12 #define EXT2_MAXBSIZE (1 << EXT2_LOG_MAXBSIZE) +#ifndef nitems +#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif + /* prototypes */ void mke2fs(const char *, int, int); |