On 27/02/13 23:15, Pete Batard wrote:
> For your consideration. This is part of the WinCE cleanup I mentioned 
> some time ago.

Thank you for taking the time to do that. It certainly does simplify things.

>
> While this is impacts a whole bunch of files, but it's mostly cleanup, 
> and I tested compilation on everything but OS-X or *BSD (and yes, 
> WinCE compilation was tested).
>
> The most controversial element is probably the inclusion of 
> <winsock.h> in libusb.h for all Windows platforms but cygwin. This is 
> needed for struct timeval and other stuff.

Why winsock.h and not winsock2.h? Does the WDK only include winsock.h? 
As far as I understand it, winsock2 seems to have been in Windows 98 and 
beyond.

> Now <winsock.h> and <winsock2.h> don't get along well [1], so some 
> people might see an issue with that, but we already include 
> <windows.h> in libusb.h, that includes <winsock.h> unless you're using 
> WIN32_LEAN_AND_MEAN, so it shouldn't change much.

This is going to be a bit annoying for us as we already use winsock2.h 
in some files which also include libusb.h. However I believe the fix is 
to just #include <winsock2.h> before we #include <libusb.h> it shouldn't 
be too bad.

Can we have a release note saying as much so that people who upgrade and 
see this issue can easily workout how to fix it?

>
> You may of course ask why then, since we include windows.h, we need an 
> additional include for winsock? This is due to WDK and WinCE requiring 
> it (most likely because they have LEAN_AND_MEAN), and the inability to 
> differentiate WDK from VS.

I certainly agree that API header files should include all the 
dependencies they require so that a file wanting to use the API should 
just have to #include that header and nothing else.

> Of course, the alternative would be to check for WIN32_LEAN_AND_MEAN, 
> but we're mostly dealing with platform ifdefs in libusb.h, so I 
> preferred to keep it that way.

It sounds sensible to me to avoid checking WIN32_LEAN_AND_MEAN in the 
header.

Regards,

Toby

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to