X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.h;h=07fcd7147eee18c249030fd326ec20b0c2869ef8;hp=15067c73c48f1b54b15ddfb327db9b8380dd16ff;hb=1ad9e4cc95b76fa304f6e21723eaf2fb457e0006;hpb=74387f27647e7123e233d31d36daedc6b485650a diff --git a/src/ftdi.h b/src/ftdi.h index 15067c7..07fcd71 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -2,7 +2,7 @@ ftdi.h - description ------------------- begin : Fri Apr 4 2003 - copyright : (C) 2003-2013 by Intra2net AG and the libftdi developers + copyright : (C) 2003-2014 by Intra2net AG and the libftdi developers email : opensource@intra2net.com ***************************************************************************/ @@ -20,6 +20,18 @@ #include #include +/* 'interface' might be defined as a macro on Windows, so we need to + * undefine it so as not to break the current libftdi API, because + * struct ftdi_context has an 'interface' member + * As this can be problematic if you include windows.h after ftdi.h + * in your sources, we force windows.h to be included first. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +#include +#if defined(interface) +#undef interface +#endif +#endif + /** FTDI chip type */ enum ftdi_chip_type { @@ -106,7 +118,7 @@ enum ftdi_module_detach_mode #define EN_ADAPTIVE 0x96 #define DIS_ADAPTIVE 0x97 #define CLK_BYTES_OR_HIGH 0x9c -#define CLK_BYTES_OR_LOW 0x0d +#define CLK_BYTES_OR_LOW 0x9d /*FT232H specific commands */ #define DRIVE_OPEN_COLLECTOR 0x9e /* Value Low */ @@ -452,7 +464,7 @@ extern "C" void ftdi_free(struct ftdi_context *ftdi); void ftdi_set_usbdev (struct ftdi_context *ftdi, struct libusb_device_handle *usbdev); - struct ftdi_version_info ftdi_get_library_version(); + struct ftdi_version_info ftdi_get_library_version(void); int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product); @@ -490,7 +502,7 @@ extern "C" int ftdi_read_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize); int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize); - int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size); + int ftdi_write_data(struct ftdi_context *ftdi, const unsigned char *buf, int size); int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize); int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize);