diff options
author | Pete Batard <pbatard@gmail.com> | 2010-01-26 01:46:17 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-01-26 01:46:17 +0000 |
commit | 03265db68a3aa3a5737417a4081c603c96e29d2c (patch) | |
tree | 38eb2b7990b1f2a5ac233a0ec44ec587eefd77cd /examples | |
parent | 9459dd37f04fe5de141b8a3f22ead1b41b5e6b82 (diff) | |
download | libusb-03265db68a3aa3a5737417a4081c603c96e29d2c.tar.gz |
r116: DDK build completion (Orin Eman):
- lsusb/xusb sources + ddk_build call
- missing libusb_strerror in .def
- removed "handle_timeouts_locked unused" warning in in io.c for MinGW
Diffstat (limited to 'examples')
-rw-r--r-- | examples/lsusb.c | 6 | ||||
-rw-r--r-- | examples/lsusb_sources | 36 | ||||
-rw-r--r-- | examples/xusb.c | 8 | ||||
-rw-r--r-- | examples/xusb_sources | 36 |
4 files changed, 83 insertions, 3 deletions
diff --git a/examples/lsusb.c b/examples/lsusb.c index 317adf0..58d58fe 100644 --- a/examples/lsusb.c +++ b/examples/lsusb.c @@ -41,7 +41,11 @@ static void print_devs(libusb_device **devs) } } -int main(void) +int +#ifdef _MSC_VER +__cdecl +#endif +main(void) { libusb_device **devs; int r; diff --git a/examples/lsusb_sources b/examples/lsusb_sources new file mode 100644 index 0000000..fcb4c4d --- /dev/null +++ b/examples/lsusb_sources @@ -0,0 +1,36 @@ +TARGETNAME=lsusb +TARGETTYPE=PROGRAM + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL + +MSC_WARNING_LEVEL=/W3 + +!ENDIF + + + +!IF "$(_BUILDARCH)"=="AMD64" + +PTHREAD_LIB=pthreadVC2_x64.lib + +!ELSE + +PTHREAD_LIB=pthreadVC2.lib + +!ENDIF + + + +USE_MSVCRT=1 + +UMTYPE=console + +INCLUDES=..\..\msvc;..\..;$(DDK_INC_PATH) + +UMLIBS=..\..\msvc\$(PTHREAD_LIB) \ + ..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib + +SOURCES=..\lsusb.c + diff --git a/examples/xusb.c b/examples/xusb.c index 69b3d55..34030a6 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -467,7 +467,7 @@ int test_device(uint16_t vid, uint16_t pid) nb_strings = string[0]; printf("Retrieving string descriptors...\n"); for (i=1; i<nb_strings; i++) { - if (libusb_get_string_descriptor_ascii(handle, i, string, 128) >= 0) { + if (libusb_get_string_descriptor_ascii(handle, (uint8_t)i, string, 128) >= 0) { printf("string (%d/%d): \"%s\"\n", i, nb_strings-1, string); } } @@ -505,7 +505,11 @@ int test_device(uint16_t vid, uint16_t pid) return 0; } -int main(int argc, char** argv) +int +#ifdef _MSC_VER +__cdecl +#endif +main(int argc, char** argv) { int r; diff --git a/examples/xusb_sources b/examples/xusb_sources new file mode 100644 index 0000000..609f369 --- /dev/null +++ b/examples/xusb_sources @@ -0,0 +1,36 @@ +TARGETNAME=xusb +TARGETTYPE=PROGRAM + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL + +MSC_WARNING_LEVEL=/W3 + +!ENDIF + + + +!IF "$(_BUILDARCH)"=="AMD64" + +PTHREAD_LIB=pthreadVC2_x64.lib + +!ELSE + +PTHREAD_LIB=pthreadVC2.lib + +!ENDIF + + + +USE_MSVCRT=1 + +UMTYPE=console + +INCLUDES=..\..\msvc;..\..;$(DDK_INC_PATH) + +UMLIBS=..\..\msvc\$(PTHREAD_LIB) \ + ..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib + +SOURCES=..\xusb.c + |