libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.0-24-gca7d324

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 9 Aug 2013 17:09:10 +0200 (CEST)
The branch, master has been updated
       via  ca7d32448041e33bdb206241f210ad8961f8d10c (commit)
      from  1cbfde9493c86c91f213746137307131180760db (commit)


- Log -----------------------------------------------------------------
commit ca7d32448041e33bdb206241f210ad8961f8d10c
Author: Paul Fertser <fercerpav@xxxxxxxxx>
Date:   Wed Aug 7 14:35:46 2013 +0400

    Fix mingw build issue caused by "interface" preprocessor definition
    
    Due to a weird odditie of windows, mingw has to redefine "interface" to
    "struct" in its headers as described e.g. at
    https://bugzilla.redhat.com/show_bug.cgi?id=980270
    
    So if some software includes windows.h before ftdi.h, it'll lead to a
    build failure. This snippet, borrowed from libusb, fixes it.
    
    Signed-off-by: Paul Fertser <fercerpav@xxxxxxxxx>

-----------------------------------------------------------------------

Summary of changes:
 src/ftdi.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/ftdi.h b/src/ftdi.h
index 15067c7..3d97dd9 100644
--- a/src/ftdi.h
+++ b/src/ftdi.h
@@ -20,6 +20,18 @@
 #include <stdint.h>
 #include <sys/time.h>
 
+/* '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 <windows.h>
+#if defined(interface)
+#undef interface
+#endif
+#endif
+
 /** FTDI chip type */
 enum ftdi_chip_type
 {


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v1.0-24-gca7d324, libftdi-git <=