diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | include/uhd/libusb.h | 2 | ||||
-rw-r--r-- | lib/libusb.c | 3 |
3 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index daff762..723245d 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,7 @@ fi # # Checks for library functions. # +AC_CHECK_FUNCS(libusb_strerror) # # Output diff --git a/include/uhd/libusb.h b/include/uhd/libusb.h index f64b6d9..ab2c9fd 100644 --- a/include/uhd/libusb.h +++ b/include/uhd/libusb.h @@ -33,7 +33,9 @@ extern "C" { #endif +#ifndef HAVE_LIBUSB_STRERROR extern const char *libusb_strerror(enum libusb_error err); +#endif #ifdef __cplusplus } /* extern "C" */ diff --git a/lib/libusb.c b/lib/libusb.c index 4cacbfd..e65f142 100644 --- a/lib/libusb.c +++ b/lib/libusb.c @@ -27,6 +27,8 @@ #include "uhd/libusb.h" #include <stdbool.h> + +#ifndef HAVE_LIBUSB_STRERROR const char * libusb_strerror(enum libusb_error err) { @@ -67,3 +69,4 @@ libusb_strerror(enum libusb_error err) return "Unknown error code"; } } +#endif |