Use an anonymous struct for generated string descriptors.

Submitted by:	Christoph Mallon
This commit is contained in:
Hans Petter Selasky 2013-01-30 15:49:37 +00:00
parent 23ab08715c
commit 01923b399d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246124

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 }, \
}