Use an anonymous struct for generated string descriptors.

Submitted by:	Christoph Mallon
This commit is contained in:
hselasky 2013-01-30 15:49:37 +00:00
parent 34829d74e1
commit 07f6ed056f

View File

@ -566,13 +566,12 @@ struct usb_string_descriptor {
typedef struct usb_string_descriptor usb_string_descriptor_t;
#define USB_MAKE_STRING_DESC(m,name) \
struct name { \
static const struct { \
uByte bLength; \
uByte bDescriptorType; \
uByte bData[sizeof((uint8_t []){m})]; \
} __packed; \
static const struct name name = { \
.bLength = sizeof(struct name), \
} __packed name = { \
.bLength = sizeof(name), \
.bDescriptorType = UDESC_STRING, \
.bData = { m }, \
}