From f6428705d86963cb49ce41e709afd02ff39e04a7 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Tue, 10 Mar 2020 15:59:20 +0000 Subject: [PATCH] Fix for building libusb under Linux. MFC after: 3 days Sponsored by: Mellanox Technologies --- lib/libusb/libusb_global_linux.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libusb/libusb_global_linux.h b/lib/libusb/libusb_global_linux.h index 3753a9fba309..9886bd4486f5 100644 --- a/lib/libusb/libusb_global_linux.h +++ b/lib/libusb/libusb_global_linux.h @@ -77,4 +77,11 @@ } while (0) #endif +#ifndef TAILQ_FOREACH_SAFE +#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = TAILQ_FIRST((head)); \ + (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) +#endif + #endif /* _LIBUSB_GLOBAL_LINUX_H_ */