On Fri, Jan 14, 2011 at 4:37 AM, Mike Frysinger <[email protected]> wrote:
>> Please note that 'interface' appeared to be a
>> reserved keyword in the Windows compile, so we used interfaceb.
>
> how does libftdi work then ?  it too uses "interface".

"interface" is indeed defined elsewhere under Windows.
libftdi (or libftdi-1.0) is fine since it includes libusb-win32's usb.h
(or libusb-1.0's libusb.h). Both libusb-win32's usb.h
and libusb-1.0's libusb.h undefine "interface".

1) libusb-win32's usb.h
**********
#ifndef __USB_H__
#define __USB_H__

#include <stdlib.h>
#include <windows.h>

/*
 * 'interface' is defined somewhere in the Windows header files. This macro
 * is deleted here to avoid conflicts and compile errors.
 */

#ifdef interface
#undef interface
#endif
...
***********

2) libusb-1.0's libusb.h
http://www.libusb.org/browser/libusb/libusb/libusb.h
38      /* 'interface' might be defined as a macro on Windows, so we need to
39       * undefine it so as not to break the current libusb API, because
40       * libusb_config_descriptor has an 'interface' member
41       * As this can be problematic if you include windows.h after libusb.h
42       * in your sources, we force windows.h to be included first. */
43      #if defined(_WIN32) || defined(__CYGWIN__)
44      #include <windows.h>
45      #if defined(interface)
46      #undef interface
47      #endif
48      #endif



-- 
Xiaofan

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to