Don't #include <libusb.h> from ftdi.h
authorAnders Larsen <al@alarsen.net>
Sun, 13 Jan 2013 15:02:00 +0000 (16:02 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 15 Jan 2013 16:47:02 +0000 (17:47 +0100)
Libusb is used internally but (normally) not needed by an application
directly, so don't include <libusb.h> from the exposed interface header.

Signed-off-by: Anders Larsen <al@alarsen.net>

ftdipp/ftdi.cpp
libftdi1.pc.in
src/ftdi.h
src/ftdi_stream.c

index 167325a..0382fa4 100644 (file)
@@ -26,6 +26,7 @@ in accordance with section (3) of the GNU General Public License.
 This exception does not invalidate any other reasons why a work based
 on this file might be covered by the GNU General Public License.
 */
+#include <libusb.h>
 #include "ftdi.hpp"
 #include "ftdi_i.h"
 #include "ftdi.h"
index 300f38c..13f616c 100644 (file)
@@ -2,12 +2,10 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
-libusb_libs=@LIBUSB_1_0_LIBS@
-libusb_cflags=@LIBUSB_1_0_CFLAGS@
 
 Name: libftdi1
 Description: Library to program and control the FTDI USB controller
 Requires: libusb-1.0
 Version: @VERSION@
-Libs: -L${libdir} -lftdi1 ${libusb_libs}
-Cflags: -I${includedir} ${libusb_cflags}
+Libs: -L${libdir} -lftdi1
+Cflags: -I${includedir}
index 0348eea..141a795 100644 (file)
@@ -17,7 +17,8 @@
 #ifndef __libftdi_h__
 #define __libftdi_h__
 
-#include <libusb.h>
+#include <stdint.h>
+#include <sys/time.h>
 
 /** FTDI chip type */
 enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2, TYPE_R=3, TYPE_2232H=4, TYPE_4232H=5, TYPE_232H=6 };
index 7a8c140..cf3acf5 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <libusb.h>
 
 #include "ftdi.h"