Use our own bitmap macros instead of borrowing the ones from select.

This commit is contained in:
Todd C. Miller
2015-06-23 16:37:00 -06:00
parent 7b086b6842
commit a76b93e23a
4 changed files with 21 additions and 28 deletions

View File

@@ -132,6 +132,12 @@
# define mtim_get(_x, _y) do { (_y).tv_sec = (_x)->st_mtime; (_y).tv_nsec = 0; } while (0)
#endif /* HAVE_ST_MTIM */
/* Bit map macros. */
#define sudo_setbit(_a, _i) ((_a)[(_i) / NBBY] |= 1 << ((_i) % NBBY))
#define sudo_clrbit(_a, _i) ((_a)[(_i) / NBBY] &= ~(1<<((_i) % NBBY)))
#define sudo_isset(_a, _i) ((_a)[(_i) / NBBY] & (1<<((_i) % NBBY)))
#define sudo_isclr(_a, _i) (((_a)[(_i) / NBBY] & (1<<((_i) % NBBY))) == 0)
/*
* Macros to quiet gcc's warn_unused_result attribute.
*/