libftdi Archives

Subject: Re: [RFC][PATCH] explicitly include libusb-1.0

From: Matthias Janke <matthias.janke@xxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Sun, 13 Jan 2013 21:06:13 +0100
> On 2013-01-13 14:33, Matthias Janke wrote:
> > Beeing lazy is one motivaton for the patch. The other one is that
> > compiling an application is differnt from linking. When you link
> > libusb is proxied by libftdi, since libftdi is linked against
> > libusb, so on the linker cmd line there is only -lftdi1. So you
> > don't care about
> > libusb/x at all. But when you compile you have to include libusb
> > explicitly even if you don't use it in your application. This
> > breaks abstraction layers.
> 
> IMHO it would be better to not include <libusb.h> at all when
> compiling your application (unless the application needs it directly).

Full ACK.

> The attached patch removes said include from the exposed header
> ftdi.h and instead includes libusb.h in the libftdi sources where
> needed - ftdi.h itself did not need the declarations from libusb.h.
> (Caveat: Only compile-tested, and only on Linux)

That's probably the better fix. Tested with my projects and works fine
on Linux. 

Thanks,
Matthias

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

Current Thread