tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: <sys/bitops.h> needs <sys/types.h>



On Thu, Mar 08, 2018 at 10:22:13AM +0100, Martin Husemann wrote:
 > Trying to compile a sample from the bitops man page fails,
 > #include <sys/bitops.h> is not enough, as the __BITMAP_* macros use NBBY
 > to convert from bit indices to bytes.
 > 
 > I would just add #include <sys/types.h> to the synopsis in the man page,
 > but given how stupid that constant 8 is - should we instead make the
 > sys/bitops.h header default to 8 bits per byte if NBBY is not defined?

It should use CHAR_BIT (the standard C symbol) and we should provide a
nonpolluting __CHAR_BIT from ansi.h or whatever so it can use that
without pulling in additional things.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index