diff options
author | Pete Batard <pbatard@gmail.com> | 2010-01-21 11:19:59 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-01-21 11:19:59 +0000 |
commit | c8bec80afba23b1d09151927e707c86c8bda504c (patch) | |
tree | 91a0ff36f958a2add7bc66ab9219ca51921a75c1 | |
parent | 3fa6b35e7e89f48749bf0d05d4d03e7ffe51f431 (diff) | |
download | libusb-c8bec80afba23b1d09151927e707c86c8bda504c.tar.gz |
r97: minor fixes for cygwin and sources
-rw-r--r-- | libusb/os/sources | 2 | ||||
-rw-r--r-- | libusb/os/windows_compat.h | 8 | ||||
-rw-r--r-- | libusb/os/windows_usb.c | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/libusb/os/sources b/libusb/os/sources index bc1bde2..f2018d5 100644 --- a/libusb/os/sources +++ b/libusb/os/sources @@ -7,7 +7,7 @@ DLLDEF=..\libusb-1.0.def MSC_WARNING_LEVEL=/W3 !ENDIF -!IFDEF WIN64 +!IFDEF _AMD64bit PTHREAD_LIB=pthreadVC2_x64.lib !ELSE PTHREAD_LIB=pthreadVC2.lib diff --git a/libusb/os/windows_compat.h b/libusb/os/windows_compat.h index 8cae332..f40f5de 100644 --- a/libusb/os/windows_compat.h +++ b/libusb/os/windows_compat.h @@ -77,12 +77,9 @@ struct winfd fd_to_winfd(int fd); struct winfd handle_to_winfd(HANDLE handle); struct winfd overlapped_to_winfd(OVERLAPPED* overlapped); -// On Windows, timeval (defined in WinSock.h) uses long for its members - -/* - * Structure used in select() call, taken from the BSD file sys/time.h. - */ +// When building using the MSDDK and sources #if defined(DDKBUILD) +#if !defined(timeval) struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ @@ -102,6 +99,7 @@ struct timeval { #if !defined(timerclr) #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 #endif +#endif #if !defined(TIMESPEC_TO_TIMEVAL) #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index b5ce63f..f37f36a 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -157,7 +157,8 @@ static char* guid_to_string(const GUID guid) { static char guid_string[GUID_STRING_LENGTH]; - sprintf(guid_string, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", guid.Data1, guid.Data2, guid.Data3, + sprintf(guid_string, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + (unsigned int)guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); return guid_string; |