summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-01-21 12:10:43 +0000
committerPete Batard <pbatard@gmail.com>2010-01-21 12:10:43 +0000
commita535ea35cd534e7b1d478dd37cbfcda8f1517c8f (patch)
tree6626533bb5ceaaedc509d2953ae6e5f98510e45c
parentc8bec80afba23b1d09151927e707c86c8bda504c (diff)
downloadlibusb-a535ea35cd534e7b1d478dd37cbfcda8f1517c8f.tar.gz
r98: additional MSVC6 fixes
-rw-r--r--README_MSVC.txt26
-rw-r--r--libusb/os/windows_compat.c3
-rw-r--r--libusb/os/windows_usb.h5
3 files changed, 17 insertions, 17 deletions
diff --git a/README_MSVC.txt b/README_MSVC.txt
index 938a10d..248d419 100644
--- a/README_MSVC.txt
+++ b/README_MSVC.txt
@@ -1,8 +1,8 @@
-To compile libusb 1.0 using Microsoft Visual Studio:
+To compile libusb 1.0 using either Microsoft Visual Studio or the Windows DDK
-Note 1: Two set of solution files are provided depending on whether you are
-running Visual Studio 2008 (MSVC9) or Visual Studio 2005 (MSVC8).
-Make sure you open the solution file matching your environment.
+Note 1: For Visual Studio, two set of solution files are provided depending on
+whether you are running Visual Studio 2008 (MSVC9) or Visual Studio 2005
+(MSVC8). For the DDK, the 'sources' file is located in libusb\os\.
Note 2: In the text below, (Win32) means "when producing 32 bit binaries" and
(x64) "when producing 64 bit binaries". This is independent of whether your
@@ -35,21 +35,15 @@ platform is actually 32 or 64 bit.
- Edit config_msvc.h according to your needs (you might want to comment out
ENABLE_DEBUG_LOGGING).
-
-- If you haven't done so, download and install the latest Windows DDK
- (http://www.microsoft.com/downloads/details.aspx?FamilyID=2105564e-1a9a-4bf4-8d74-ec5b52da3d00)
-
-- In Visual Studio, go to Tools -> Options -> Projects and Solutions ->
- VC++ directories and add the following to "Include files":
- <path of Windows DDK>\inc
-
-- Also in VC++ directories and add the following to "Library files":
- <path of Windows DDK>\lib\<target platform>\<arch>
- Where <targe platform> is one of wxp, wlh (Vista) or win7 and <arch> is
- one of i386 or amd64, depending on whether Platform is Win32 or x64.
You should now be able to compile the solution.
+Note that if the the compilation process complains about missing libraries,
+you will need to ensure that the default library paths for your project point
+to a directory that contains setupapi.lib and ole32.lib.
+If needed, these libraries can be obtained by downloading either the latest
+Windows SDK or the DDK.
+
The default solution is set to produce the static library and statically
linked binaries. The DLL is currently built as a standalone project.
diff --git a/libusb/os/windows_compat.c b/libusb/os/windows_compat.c
index dfab210..a7f68d2 100644
--- a/libusb/os/windows_compat.c
+++ b/libusb/os/windows_compat.c
@@ -65,11 +65,12 @@
* TODO: Once MinGW supports it (or for other compilation platforms) use
* CancelIoEx instead of CancelIo for Vista and later platforms
*/
+#include <windows.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#include <windows.h>
+#include <stdint.h>
#include <pthread.h>
#include <io.h>
diff --git a/libusb/os/windows_usb.h b/libusb/os/windows_usb.h
index f9904ba..2463ff8 100644
--- a/libusb/os/windows_usb.h
+++ b/libusb/os/windows_usb.h
@@ -40,6 +40,11 @@
#define LIBUSB_DEVADDR_MAX UINT8_MAX
#endif
+// Missing from MSVC6 setupapi.h
+#if !defined(SPDRP_ADDRESS)
+#define SPDRP_ADDRESS 28
+#endif
+
#if defined(__CYGWIN__ )
// cygwin produces a warning unless these prototypes are defined
extern int _snprintf(char *buffer, size_t count, const char *format, ...);