Ticket #9: 620_win32-usb.patch

File 620_win32-usb.patch, 3.1 KB (added by hsattler, 18 months ago)

require and use libusb-win32

  • openobex-anoncvs

    old new  
    147147]) 
    148148 
    149149AC_DEFUN([AC_PATH_USB], [ 
     150        usb_lib_found=no 
    150151        case $host in 
    151152        *-*-mingw32*) 
    152153                USB_CFLAGS="" 
    153154                USB_LIBS="-lusb" 
     155                usb_lib_found=yes 
    154156                ;; 
    155157        *) 
    156                 PKG_CHECK_MODULES(USB, libusb, usb_found=yes, AC_MSG_RESULT(no)) 
     158                PKG_CHECK_MODULES(USB, libusb, usb_lib_found=yes, AC_MSG_RESULT(no)) 
     159                AC_CHECK_FILE(${prefix}/lib/pkgconfig/libusb.pc, REQUIRES="libusb") 
    157160                ;; 
    158161        esac 
    159162        AC_SUBST(USB_CFLAGS) 
    160163        AC_SUBST(USB_LIBS) 
    161         AC_CHECK_LIB(usb, usb_get_busses, dummy=yes, AC_DEFINE(NEED_USB_GET_BUSSES, 1, [Define to 1 if you need the usb_get_busses() function.])) 
    162         AC_CHECK_LIB(usb, usb_interrupt_read, dummy=yes, AC_DEFINE(NEED_USB_INTERRUPT_READ, 1, [Define to 1 if you need the usb_interrupt_read() function.])) 
     164 
     165        usb_get_busses=no 
     166        AC_CHECK_LIB(usb, usb_get_busses, usb_get_busses=yes, AC_DEFINE(NEED_USB_GET_BUSSES, 1, [Define to 1 if you need the usb_get_busses() function.])) 
     167 
     168        usb_interrupt_read=no 
     169        AC_CHECK_LIB(usb, usb_interrupt_read, usb_interrupt_read=yes, AC_DEFINE(NEED_USB_INTERRUPT_READ, 1, [Define to 1 if you need the usb_interrupt_read() function.])) 
     170 
     171        if (test "$usb_lib_found" = "yes" && test "$usb_get_busses" = "yes" && test "$usb_interrupt_read" = "yes"); then 
     172                usb_found=yes 
     173        else 
     174                usb_found=no 
     175        fi 
    163176]) 
    164177 
    165178AC_DEFUN([AC_PATH_GLIB], [ 
     
    263276 
    264277        if (test "${usb_enable}" = "yes" && test "${usb_found}" = "yes"); then 
    265278                AC_DEFINE(HAVE_USB, 1, [Define if system supports USB and it's enabled]) 
    266                 AC_CHECK_FILE(${prefix}/lib/pkgconfig/libusb.pc, REQUIRES="libusb") 
    267279        fi 
    268280 
    269281        AM_CONDITIONAL(GLIB, test "${glib_enable}" = "yes" && test "${glib_found}" = "yes") 
  • openobex-anoncvs

    old new  
    5959/* "Union Functional Descriptor" from CDC spec 5.2.3.X 
    6060 * used to find data/slave OBEX interface */ 
    6161struct cdc_union_desc { 
    62         u_int8_t      bLength; 
    63         u_int8_t      bDescriptorType; 
    64         u_int8_t      bDescriptorSubType; 
     62        uint8_t      bLength; 
     63        uint8_t      bDescriptorType; 
     64        uint8_t      bDescriptorSubType; 
    6565 
    66         u_int8_t      bMasterInterface0; 
    67         u_int8_t      bSlaveInterface0; 
     66        uint8_t      bMasterInterface0; 
     67        uint8_t      bSlaveInterface0; 
    6868} __attribute__ ((packed)); 
    6969 
    7070/* CDC class and subclass types */ 
  • openobex-anoncvs

    old new  
    3737#include <unistd.h> 
    3838#include <stdio.h>              /* perror */ 
    3939#include <errno.h>              /* errno and EADDRNOTAVAIL */ 
     40 
     41 
     42#ifdef _WIN32 
     43#include <windows.h> 
     44#else 
    4045#include <netinet/in.h> 
    4146#include <sys/socket.h> 
     47#endif 
    4248 
    4349#include <usb.h> 
    4450