[PATCH 5/5] guid_to_string is only discarded when macro-usbi_dbg used

Pete Batard pete at akeo.ie
Mon Jan 30 17:34:41 EST 2012


This one is just to address a warning, but since it doesn't impact core 
(only windows_usb.c needs patching), and the warning seems prominent, we 
might as well apply it.

Original [PATCH 05/11] from Michael.

This means that Michael's patches 2 and [6-10] are being leftover for now.

Out of those, #2, #7, #9 and #10 are low impact (typos, MSVC6 only 
stuff, update an error message) and could probably be applied quickly 
and without trouble, so if you want them, I can forward them.

However #6 and especially #8 don't look like workable candidates at the 
moment.

I can also forward a small patch to adds the SuperSpeed ID for Windows, 
since I was able to confirm the currently undocumented value through 
test (one liner, as per [1]), but I'll only do so on request, and unless 
we highlight an issue, these are the only patches I'll mention until the 
libusbx-1.0.9 release.

Regards,

/Pete

[1] 
http://git.libusb.org/?p=libusb-pbatard.git;a=commitdiff;h=e182dbad23570634d6cca971aa6b820898377d4e;js=1

-------- Original Message --------
Subject: [Libusb-devel] [PATCH 05/11] guid_to_string is only discarded 
when macro-usbi_dbg used
Date: Fri, 23 Dec 2011 18:47:06 -0600
From: Michael Plante <michael.plante at gmail.com>
To: libusb-devel <libusb-devel at lists.sourceforge.net>

>From 09234782082515fb4b1283ac304d16a2b4d389c0 Mon Sep 17 00:00:00 2001
From: Michael Plante <michael.plante at gmail.com>
Date: Fri, 23 Dec 2011 16:50:21 -0600
Subject: [PATCH 05/11] guid_to_string is only discarded when 
macro-usbi_dbg used

* usbi_dbg encloses all references to guid_to_string
* MinGW/cygwin warn about an unused function, so the #if
   squelches this warning
* MSVC6 uses a variadic function form of usbi_dbg instead
   of a macro, so the compiler still "sees" guid_to_string
   and it therefore needs to always be defined for MSVC6,
   even if it's only a stub.
* So we define it if usbi_dbg is used OR if MSVC6 is used.

Signed-off-by: Michael Plante <michael.plante at gmail.com>
---
  libusb/os/windows_usb.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index 68216db..dcc7e7f 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -122,7 +122,7 @@ static inline BOOLEAN guid_eq(const GUID *guid1,
const GUID *guid2) {
  	return false;
  }

-#if defined(ENABLE_DEBUG_LOGGING)
+#if defined(ENABLE_DEBUG_LOGGING) || (defined(_MSC_VER) && _MSC_VER <= 
1200)
  static char* guid_to_string(const GUID* guid)
  {
  	static char guid_string[MAX_GUID_STRING_LENGTH];
-- 
1.7.3.1.msysgit.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-guid_to_string-is-only-discarded-when-macro-usbi_dbg.patch
Type: application/octet-stream
Size: 1283 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libusbx/attachments/20120130/6151f2c1/attachment.obj>


More information about the libusbx mailing list