From a9364a866f99334f3aee5a58480ae5bc5e7a5a02 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 11 May 2015 19:44:23 +1000 Subject: [PATCH] Patch HID bootloader host app to fix Windows compilation (thanks to Duncan McDonald). --- Bootloaders/HID/HostLoaderApp/Makefile | 3 ++- Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Bootloaders/HID/HostLoaderApp/Makefile b/Bootloaders/HID/HostLoaderApp/Makefile index 7b2833e62f..d7d6458a5c 100644 --- a/Bootloaders/HID/HostLoaderApp/Makefile +++ b/Bootloaders/HID/HostLoaderApp/Makefile @@ -13,8 +13,9 @@ hid_bootloader_cli: hid_bootloader_cli.c else ifeq ($(OS), WINDOWS) CC = i586-mingw32msvc-gcc CFLAGS ?= -O2 -Wall +LDLIB = -lsetupapi -lhid hid_bootloader_cli.exe: hid_bootloader_cli.c - $(CC) $(CFLAGS) -s -DUSE_WIN32 -o hid_bootloader_cli.exe hid_bootloader_cli.c -lhid -lsetupapi + $(CC) $(CFLAGS) -s -DUSE_WIN32 -o hid_bootloader_cli.exe hid_bootloader_cli.c $(LDLIB) else ifeq ($(OS), MACOSX) diff --git a/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c b/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c index 058ccc63da..cdee1c30cd 100644 --- a/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c +++ b/Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c @@ -934,8 +934,8 @@ int printf_verbose(const char *format, ...) void delay(double seconds) { - #ifdef WIN32 - Sleep(seconds * 1000.0); + #ifdef USE_WIN32 + sleep(seconds * 1000.0); #else usleep(seconds * 1000000.0); #endif @@ -951,7 +951,7 @@ void die(const char *str, ...) exit(1); } -#if defined(WIN32) +#if defined USE_WIN32 #define strcasecmp stricmp #endif