MATLAB: Does LOADLIBRARY support the use of bitfields in structures

bitfieldlibstructloadlibraryMATLABunion

I have a header file that defines a struct that contains a bitfield. I would like to load this structure using LOADLIBRARY and LIBSTRUCT. When loading the library, I receive the following error message:
Bitfields are unsupported in structures. Structure full_of_fields skipped.
Here is an example of a definition of a bitfield within a struct:
int testerfunc();
struct full_of_fields{
/* field 4 bits wide */
unsigned field1 :4;
};

Best Answer

Structures that contain bitfields are not supported with MATLAB's generic DLL interface.
To use bitfields, it is necessary to replace bitfield members with an int type and use bit manipulation in MATLAB. Here is how the example could be modified:
int testerfunc();
struct full_of_fields{
/* field 8 bits wide to be manipulated in MATLAB*/
char field1;
};