2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Add definition of nitems for those without it and use it throughout.

This commit is contained in:
Todd C. Miller
2016-06-23 10:58:07 -06:00
parent ff2cd3cf27
commit f683cbd582
9 changed files with 19 additions and 21 deletions

View File

@@ -237,6 +237,13 @@ typedef struct sigaction sigaction_t;
# define SA_RESTART 0
#endif
/*
* The nitems macro may be defined in sys/param.h
*/
#ifndef nitems
# define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
#endif
/*
* If dirfd() does not exists, hopefully dd_fd does.
*/