Fixed clang++ complaining about unnamed structs aren't allow in anonymous unions

This commit is contained in:
Ingo Ruhnke 2015-06-20 13:50:44 +02:00
parent 8e599fbacd
commit 375caacbc2
2 changed files with 37 additions and 30 deletions

View file

@ -25,26 +25,30 @@ class MacroButtonEventHandler : public ButtonEventHandler
{
public:
private:
struct AbsInfo {
UIEvent event;
int minimum;
int maximum;
int fuzz;
int flat;
};
struct Event {
UIEvent event;
int value;
};
struct Time {
int msec;
};
struct MacroEvent {
enum { kInitOp, kSendOp, kWaitOp, kNull } type;
union {
struct {
UIEvent event;
int minimum;
int maximum;
int fuzz;
int flat;
} init;
struct {
UIEvent event;
int value;
} send;
struct {
int msec;
} wait;
AbsInfo init;
Event send;
Time wait;
};
};

View file

@ -116,21 +116,24 @@ private:
{
uint8_t type;
union {
struct {
uint8_t unknown1;
uint8_t unknown2;
uint8_t count1;
uint8_t count2;
} __attribute__((__packed__)) clock;
struct ClockData {
uint8_t unknown1;
uint8_t unknown2;
uint8_t count1;
uint8_t count2;
} __attribute__((__packed__));
struct {
uint8_t zero1;
uint8_t modifier;
uint8_t scancode1;
uint8_t scancode2;
uint8_t zero3;
} __attribute__((__packed__)) key;
struct KeyData {
uint8_t zero1;
uint8_t modifier;
uint8_t scancode1;
uint8_t scancode2;
uint8_t zero3;
} __attribute__((__packed__));
union {
ClockData clock;
KeyData key;
};
} __attribute__((__packed__));