[Pkg-running-devel] [antpm] 09/31: usb: add support for ancient libusb-1.0 releases

Kristof Ralovich ralovich-guest at moszumanska.debian.org
Fri Mar 24 23:19:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

ralovich-guest pushed a commit to branch master
in repository antpm.

commit 8745981fa693ae494a2ef9f777e1e1fccad495fa
Author: RALOVICH, Kristof <tade60 at freemail.hu>
Date:   Mon Mar 28 19:30:50 2016 +0200

    usb: add support for ancient libusb-1.0 releases
    
    as travis-ci uses 1.0.9, which comes without libusb_strerror()
---
 src/SerialUsb.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/SerialUsb.cpp b/src/SerialUsb.cpp
index 8c09398..ec81c49 100644
--- a/src/SerialUsb.cpp
+++ b/src/SerialUsb.cpp
@@ -65,6 +65,7 @@ enum {
 
 
 
+#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000103)
 #define LOG_USB_WARN(func, rv)                      \
   do {                                              \
     LOG(LOG_WARN) << func << ": " << rv << ": \""   \
@@ -76,7 +77,19 @@ enum {
                   << ": \"" << libusb_strerror((libusb_error)rv) << "\"\n"            \
                   << ": \"" << static_cast<char*>(strerror(rv)) << "\"\n"; \
   } while(0)
-
+#else
+#define LOG_USB_WARN(func, rv)                      \
+  do {                                              \
+    LOG(LOG_WARN) << func << ": " << rv << ": \""   \
+                  << libusb_error_name(rv) << "\"\n"; \
+  } while(0)
+#define LOG_USB_WARN2(func, rv)                                         \
+  do {                                                                  \
+    LOG(LOG_WARN) << func << ": " << rv                                 \
+                  << ": \"" << libusb_error_name(rv) << "\"\n"            \
+                  << ": \"" << static_cast<char*>(strerror(rv)) << "\"\n"; \
+  } while(0)
+#endif
 
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/antpm.git



More information about the Pkg-running-devel mailing list