summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2009-01-25 18:21:59 +0100
committerDaniel Drake <dsd@gentoo.org>2009-02-01 19:30:21 -0300
commitabe34a2656f8f9f21e53603796c536585e6233ef (patch)
treec34ed171b4625701baea7915862cda6593bbe633
parent620075c7400764d9bb539b5c02065c45c2e8251e (diff)
downloadlibusb-abe34a2656f8f9f21e53603796c536585e6233ef.tar.gz
Make empty array in struct compatible with C99
If the compiler is known to be running in C99 mode, use "flexible array members" ("foo[]"). If the compiler is running in any other mode, continue using the non-standard but widely common "foo[0]" syntax.
-rw-r--r--libusb/libusb.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libusb/libusb.h b/libusb/libusb.h
index cc9bd3b..fab053e 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -747,7 +747,13 @@ struct libusb_transfer {
int num_iso_packets;
/** Isochronous packet descriptors, for isochronous transfers only. */
- struct libusb_iso_packet_descriptor iso_packet_desc[0];
+ 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
+ ;
};
int libusb_init(libusb_context **ctx);