On 2013.01.16 17:08, Toby Gray wrote:
> There are a couple of changes that are needed to get it to build on WinCE. 
> See the attached patch.

Ah, my bad. I had to apply a few changes to poll_windows, and decided I 
might as well use the same naming conventions for the attributes you 
added, but it looks like I missed a couple changes.

I'll try to include the necessary fixes in the existing commit.

> I don't quite understand why poll_windows.h now needs to explicitly include
 > <libusb.h> (for ssize_t). I assume it must have just been luck before
 > that all files which #included poll_windows.h happened to have already
 > included libusb.h.

Well that's relevant to one of the issue I had to fix in your code 
actually, and part of what I wanted to mention.
You added a struct usbi_transfer attribute in poll_windows.h's struct 
winfd. However, struct usbi_transfer is defined in libusbi.h, which 
itself included poll_windows.h *before* the definition of struct 
usbi_transfer, so the compiler was (rightfully) complaining about it.

Thus I had to move the #include of poll_windows.h after struct 
usbi_transfer in libusbi.h [1]. I was also able to remove the need for 
the libusb.h include there, and I would prefer to keep that header away 
if it's just for a ssize_t definition (which is indeed defined in 
libusb.h for platforms that don't have it).

Looking at the code, I think the reason you get the ssize_t issue (and 
other Windows platforms don't) is because you don't include libusbi.h 
(which in turn includes libusb.h) before poll_windows.h, in wince_usb.h.

I'd also prefer if the only include in wince_usb.h was for 
windows_common.h, and the other ones moved to wince_usb.c (before the 
#include wince_usb.h), though I don't really care about this kind of 
cleanup occurring after the current proposal have been added to 
mainline, as there's some other cleanup that I'd like to perform 
(libusb.h does include <sys/types.h> if available, so I think we should 
be able to remove some of the #ifdef'd code from the samples).

The other issue I had to take care of was that thread_windows is not 
being used on all Windows platforms: cygwin uses thread_posix. Therefore 
the usbi_sleep() was causing us issues there, and I duplicated as a 
simple one liner define in both poll_windows and threaf_windows.

Finally, to remove another WinCE ifdef in core.c, I'm wondering if we 
couldn't define an inline GetSystemTimeAsFileTime() for CE in missing.h. 
I'm also thinking about defining a fake SleepEx() there, to remove the 
need for usbi_sleep altogether. Again, these are two items that I'd see 
better suited to do post integration, as I don't see much of a problem 
leaving extra cleanup for later.

For now, if you can confirm that the inclusion of libusbi.h, either in 
wince_usb.h or wince_usb.c removes the need for the libusb.h in 
poll_windows, I think I'll have enough to proceed with the integration, 
though I'll probably wait a few days to try to run some more tests 
before I push anything.

Regards,

/Pete

[1] 
https://github.com/pbatard/libusbx/commit/29c5c85f4c77ee965d51492cb84da96d13da528d

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to