From 7522a9fbc72f14c5cb7fbaa54fb57526c5221d85 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 16 Dec 2016 15:39:46 +0100 Subject: all: Fix compilation when u_int*_t are not defined and used by usb.h --- src/cold-flash.c | 2 -- src/nolo.c | 2 -- src/usb-device.c | 14 ++++++-------- src/usb-device.h | 7 +++++++ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/cold-flash.c b/src/cold-flash.c index fc2e86b..6338670 100644 --- a/src/cold-flash.c +++ b/src/cold-flash.c @@ -22,8 +22,6 @@ #include #include -#include - #include "global.h" #include "cold-flash.h" #include "image.h" diff --git a/src/nolo.c b/src/nolo.c index 1dd9d61..9faea56 100644 --- a/src/nolo.c +++ b/src/nolo.c @@ -22,8 +22,6 @@ #include #include -#include - #include "nolo.h" #include "image.h" #include "global.h" diff --git a/src/usb-device.c b/src/usb-device.c index 391574a..24ce4be 100644 --- a/src/usb-device.c +++ b/src/usb-device.c @@ -31,14 +31,6 @@ #include #include -#include - -#ifdef __linux__ -#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP -#include -#endif -#endif - #include "global.h" #include "device.h" #include "usb-device.h" @@ -47,6 +39,12 @@ #include "cold-flash.h" #include "mkii.h" +#ifdef __linux__ +#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP +#include +#endif +#endif + static struct usb_flash_device usb_devices[] = { { 0x0421, 0x0096, -1, -1, -1, FLASH_DISK, { DEVICE_RX_44, 0 } }, { 0x0421, 0x0105, 2, 1, -1, FLASH_NOLO, { DEVICE_SU_18, DEVICE_RX_44, DEVICE_RX_48, DEVICE_RX_51, DEVICE_RM_680, 0 } }, diff --git a/src/usb-device.h b/src/usb-device.h index 101fbcd..082bf73 100644 --- a/src/usb-device.h +++ b/src/usb-device.h @@ -20,6 +20,13 @@ #ifndef USB_DEVICE_H #define USB_DEVICE_H +#include + +/* u_int*_t types are not defined without _GNU_SOURCE but usb.h needs them */ +#define u_int8_t uint8_t +#define u_int16_t uint16_t +#define u_int32_t uint32_t + #include #define USB_READ_EP (USB_ENDPOINT_IN | 0x1) -- cgit v1.2.3