I've written a header file (bitfield.h) that provides structures of bit fields as a template/macro library:

https://github.com/wkaras/C-plus-plus-library-bit-fields.

It is more portable and...