usb: Fixed the USB string descriptor internal type appearing and being defined for C++ code, the unsized array member is UB in C++
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
c31a239ae3
commit
ee418f1780
@@ -249,11 +249,13 @@ struct usb_endpoint_descriptor {
|
|||||||
/* Table 9-15 specifies String Descriptor Zero.
|
/* Table 9-15 specifies String Descriptor Zero.
|
||||||
* Table 9-16 specified UNICODE String Descriptor.
|
* Table 9-16 specified UNICODE String Descriptor.
|
||||||
*/
|
*/
|
||||||
|
#ifndef __cplusplus
|
||||||
struct usb_string_descriptor {
|
struct usb_string_descriptor {
|
||||||
uint8_t bLength;
|
uint8_t bLength;
|
||||||
uint8_t bDescriptorType;
|
uint8_t bDescriptorType;
|
||||||
uint16_t wData[];
|
uint16_t wData[];
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* From ECN: Interface Association Descriptors, Table 9-Z */
|
/* From ECN: Interface Association Descriptors, Table 9-Z */
|
||||||
struct usb_iface_assoc_descriptor {
|
struct usb_iface_assoc_descriptor {
|
||||||
@@ -275,4 +277,3 @@ enum usb_language_id {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user