if(des.idVendor == USB_VENDOR) {
if(libusb_get_bus_number(devlist[i]) == sdi->usb->bus &&
libusb_get_device_address(devlist[i]) == sdi->usb->address) {
- for (j = 0; j < sizeof(zeroplus_models) / sizeof(zeroplus_models[0]); j++) {
+ for (j = 0; j < ARRAY_SIZE(zeroplus_models); j++) {
if (des.idProduct == zeroplus_models[j].pid) {
g_message("Found PID=%04X (%s)", des.idProduct, zeroplus_models[j].model_name);
num_channels = zeroplus_models[j].channels;
#define MHZ(n) (n * 1000000)
#define GHZ(n) (n * 1000000000)
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
/* Data types, used by hardware plugins for set_configuration() */
enum {
T_UINT64,