__attribute__((ms_struct)) for bit fields

I’m trying to port some code from a Windows device driver to NET+OS. I have several structures that map to registers, per the following sample:

//////////////////////////////////////////////////////////////////////
typedef struct
{
unsigned char _1 : 1;
unsigned char _2 : 1;
unsigned char _3 : 1;
unsigned char _4 : 1;
unsigned char _5 : 1;
unsigned char _6 : 1;
unsigned char _7 : 1;
unsigned char _8 : 1;
}
attribute((packed))
attribute((ms_struct))
STRUCT_1;

STRUCT_1 s_1;

memset (&s_1, 0, sizeof (s_1));
s_1._1 = 1;

UCHAR * p = &s_1;
//////////////////////////////////////////////////////////////////////

Here’s my problem:

// * p == 0x80 // NET+OS
// * p == 0x01 // Windows

When I compile the code above, the compiler tells me:
‘ms_struct’ attribute directive ignored

Does anyone know how to enable it?

What does this have to do with iDigi Platform? Which Digi hardware are you using? What version of NET+OS?

Sorry,

Digi ESP for NET+OS
Version: 1.3.0
Build id: 10192007 NET+OS 7.3
ConnectCore 9P 9215

I moved the thread to a more appropriate forum. Hopefully you’ll get an answer here…

I’ve never run into this before, but google reveals:

http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Variable-Attributes.html

This might work?

I ended up just changing my logic, but thanks for the tip.