libftdi Archives

Subject: Re: libftdi1-1.0 and MSVC

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 20 Feb 2013 16:27:11 +0800
On Wed, Feb 20, 2013 at 10:22 AM, Xiaofan Chen <xiaofanc@xxxxxxxxx> wrote:
> Just wondering if anyone has done something to get libftdi1-1.0
> built under MSVC (2008/2010/2012)? I think some fixes are
> needed.
>
> Last time I tried it there were issues with CMake,
> Now I think the CMake issues are resolved. But there
> are still issues with  <sys/time.h> and gettimeofday.
> Ref: 
> http://developer.intra2net.com/mailarchive/html/libftdi/2011/msg00478.html
>
> And I am wondering if there is a desire to make libftdi
> compatible with MSVC or not. The examples are
> also not really compatible with MSVC last time I tried.
> If yes, I think it is worth some time to get the codes fixed.
> After all, MSVC is still the most popular compiler for
> Windows.
>
> On the other hand, it is still possible to use libftdi1-1.0
> with MSVC using the dll even if the codes are not
> compatible with MSVC. Not so sure if it is possible
> to use the Boost binding dll under MSVC though.

Even then, we need to have an ftdi.h file which is compatible
with MSVC, right now it is not due to the use of
<sys/time.h> and things like the following.

struct size_and_time
{
        uint64_t totalBytes;
        struct timeval time;
};

BTW, libusb-1.0 defaults to WINAPI calling
convention (For Windows it is equal to __stdcall,
not so sure about Windows CE) for Windows
(including Cygwin) and __cdecl for other platform.

#if defined(_WIN32) || defined(__CYGWIN__)
#define LIBUSB_CALL WINAPI
#else
#define LIBUSB_CALL
#endif

Maybe libftdi needs to adapt to that as well.

-- 
Xiaofan

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

Current Thread