summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-01-15 20:57:52 +0000
committerPete Batard <pbatard@gmail.com>2010-01-15 20:57:52 +0000
commit82ab1e7dc6229cf3513d64722c9a872325389f91 (patch)
tree1f696e4f201737fa48e2d780d0091ec336054769
parentb96e16e75ffc2b3bdd76ec5457d37d092f0a2590 (diff)
downloadlibusb-82ab1e7dc6229cf3513d64722c9a872325389f91.tar.gz
r81: amend previous workaround (should only apply to non Windows platforms)
-rw-r--r--libusb-static.vcproj204
-rw-r--r--libusb.sln38
-rw-r--r--libusb/libusb.h15
3 files changed, 248 insertions, 9 deletions
diff --git a/libusb-static.vcproj b/libusb-static.vcproj
new file mode 100644
index 0000000..f8bb905
--- /dev/null
+++ b/libusb-static.vcproj
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="libusb-1.0"
+ ProjectGUID="{349EE8F9-7D25-4909-AAF5-FF3FADE72187}"
+ RootNamespace="libusbwinusbwip"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)\libusb"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="E:\WinDDK\7600.16385.0\inc;.\msvc;.\libusb;.\"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)\libusb"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="4"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories="E:\WinDDK\7600.16385.0\inc;.\msvc;.\libusb;.\"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\libusb\core.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\descriptor.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\io.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\sync.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\os\windows_compat.c"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\os\windows_usb.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\config_msvc.h"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\libusb.h"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\libusbi.h"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\os\windows_compat.h"
+ >
+ </File>
+ <File
+ RelativePath=".\libusb\os\windows_usb.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/libusb.sln b/libusb.sln
new file mode 100644
index 0000000..fb79ae1
--- /dev/null
+++ b/libusb.sln
@@ -0,0 +1,38 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-1.0", "libusb-winusb-wip.vcproj", "{349EE8F9-7D25-4909-AAF5-FF3FADE72187}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xusb", "examples\xusb.vcproj", "{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}"
+ ProjectSection(ProjectDependencies) = postProject
+ {349EE8F9-7D25-4909-AAF5-FF3FADE72187} = {349EE8F9-7D25-4909-AAF5-FF3FADE72187}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lsusb", "examples\lsusb.vcproj", "{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}"
+ ProjectSection(ProjectDependencies) = postProject
+ {349EE8F9-7D25-4909-AAF5-FF3FADE72187} = {349EE8F9-7D25-4909-AAF5-FF3FADE72187}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32
+ {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32
+ {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32
+ {349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32
+ {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32
+ {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32
+ {3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32
+ {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32
+ {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32
+ {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/libusb/libusb.h b/libusb/libusb.h
index d345727..8caa3e2 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -23,6 +23,7 @@
#include <stdint.h>
#ifdef _MSC_VER
+#define inline __inline
#include <time.h>
#else
#include <sys/time.h>
@@ -31,12 +32,11 @@
#include <time.h>
#include <limits.h>
-// Work around for Windows "interface" macro redefinition
-#ifdef _MSC_VER
-#define inline __inline
-#pragma push_macro("interface")
-#endif
-#ifndef interface
+// Work around for existing libusb 1.0 code that might have used "interface"
+// instead of the newer "usb_interface", in libusb_config_descriptor.
+// "interface" was changed to "usb_interface" to work around macro redefinition
+// issues on Windows platforms.
+#if !defined(OS_WINDOWS) && !defined(interface)
#define interface usb_interface
#endif
@@ -1245,7 +1245,4 @@ void libusb_set_pollfd_notifiers(libusb_context *ctx,
}
#endif
-#ifdef _MSC_VER
-#pragma pop_macro("interface")
-#endif
#endif