Attention is currently required from: Nico Huber, Thomas Heijligen, Edward O'Callaghan, Angel Pons.
2 comments:
File tests/init_shutdown.c:
Patch Set #5, Line 122: (void *)
I added cast to avoid warnings about discarding const qualifier, hope it's ok.
File tests/io_mock.h:
struct libusb_endpoint_descriptor {
uint8_t offset1[2];
uint8_t bEndpointAddress;
uint8_t bmAttributes;
uint8_t offset2[5];
unsigned char *extra;
int extra_length;
};
typedef struct libusb_endpoint_descriptor libusb_endpoint_descriptor;
struct libusb_interface_descriptor {
uint8_t offset1[2];
uint8_t bInterfaceNumber;
uint8_t bAlternateSetting;
uint8_t bNumEndpoints;
uint8_t bInterfaceClass;
uint8_t bInterfaceSubClass;
uint8_t bInterfaceProtocol;
uint8_t offset2;
struct libusb_endpoint_descriptor *endpoint;
};
typedef struct libusb_interface_descriptor libusb_interface_descriptor;
struct libusb_interface {
struct libusb_interface_descriptor *altsetting;
int num_altsetting;
};
typedef struct libusb_interface libusb_interface;
struct libusb_config_descriptor {
uint8_t offset1[4];
uint8_t bNumInterfaces;
uint8_t bConfigurationValue;
uint8_t offset2[3];
struct libusb_interface *interface;
};
typedef struct libusb_config_descriptor libusb_config_descriptor;
struct libusb_device {};
typedef struct libusb_device libusb_device;
struct libusb_device_descriptor {
uint8_t offset1[8];
uint16_t idVendor;
uint16_t idProduct;
uint8_t offset2[5];
uint8_t bNumConfigurations;
};
typedef struct libusb_device_descriptor libusb_device_descriptor;
> I will re-work this patch, so that tests just include libusb.h always. […]
I included the header only once in io_mock.h and it seems to work!
One thing I am not sure about, you said to "require libusb to be around to build the tests", does it mean require it in meson build? I haven't done this last bit yet, need to see what is the right way to express the requirement.
As an experiment, I changed the line into
#include <libusb666.h>
and the error is:
../tests/io_mock.h:41:10: fatal error: libusb666.h: No such file or directory
maybe it's not a user-friendly error...
To view, visit change 57918. To unsubscribe, or for help writing mail filters, visit settings.