#include <time.h>
#include <limits.h>
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+#define ZERO_SIZED_ARRAY /* [] - valid C99 code */
+#else
+#define ZERO_SIZED_ARRAY 0 /* [0] - non-standard, but usually working code */
+#endif
+
/* 'interface' might be defined as a macro on Windows, so we need to
* undefine it so as not to break the current libusb API, because
* libusb_config_descriptor has an 'interface' member
/** Device Capability type */
uint8_t bDevCapabilityType;
/** Device Capability data (bLength - 3 bytes) */
- uint8_t dev_capability_data
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
+ uint8_t dev_capability_data[ZERO_SIZED_ARRAY];
};
/** \ingroup libusb_desc
uint8_t bNumDeviceCaps;
/** bNumDeviceCap Device Capability Descriptors */
- struct libusb_bos_dev_capability_descriptor *dev_capability
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
+ struct libusb_bos_dev_capability_descriptor *dev_capability[ZERO_SIZED_ARRAY];
};
/** \ingroup libusb_desc
int num_iso_packets;
/** Isochronous packet descriptors, for isochronous transfers only. */
- struct libusb_iso_packet_descriptor iso_packet_desc
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
+ struct libusb_iso_packet_descriptor iso_packet_desc[ZERO_SIZED_ARRAY];
};
/** \ingroup libusb_misc
struct libusb_device_descriptor device_descriptor;
int attached;
- unsigned char os_priv
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
+ unsigned char os_priv[ZERO_SIZED_ARRAY]
#if defined(OS_SUNOS)
__attribute__ ((aligned (8)));
#else
struct list_head list;
struct libusb_device *dev;
int auto_detach_kernel_driver;
- unsigned char os_priv
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
+
+ unsigned char os_priv[ZERO_SIZED_ARRAY]
#if defined(OS_SUNOS)
__attribute__ ((aligned (8)));
#else
struct discovered_devs {
size_t len;
size_t capacity;
- struct libusb_device *devices
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
- [] /* valid C99 code */
-#else
- [0] /* non-standard, but usually working code */
-#endif
- ;
+ struct libusb_device *devices[ZERO_SIZED_ARRAY];
};
struct discovered_devs *discovered_devs_append(