diff --git a/include/libopencm3/usb/usbd.h b/include/libopencm3/usb/usbd.h index 0baa7efa..83df0300 100644 --- a/include/libopencm3/usb/usbd.h +++ b/include/libopencm3/usb/usbd.h @@ -42,6 +42,9 @@ LGPL License Terms @ref lgpl_license BEGIN_DECLS +#ifndef ARRAY_LENGTH +#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(*(array))) +#endif enum usbd_request_return_codes { USBD_REQ_NOTSUPP = 0,