From: Garret Kelly <gdk@ch...> - 2012-03-23 18:37:52
I've been hitting an issue when compiling libusb under MSVC. The timeveal
struct isn't defined in any of the included headers, despite being used all
over the place, so I added an include to config.h to bring in Winsock2.h
which has the definition. However, it also has a definition for the pollfd
struct, so I've removed that from poll_windows.h.
Is this an acceptable solution?
Garret Kelly (1):
Windows: Fix compilation issue related to missing struct timeval.
libusb/os/poll_windows.h | 6 ------
msvc/config.h | 2 ++
2 files changed, 2 insertions(+), 6 deletions(-)
From: Pete Batard <pete@ak...> - 2012-03-23 19:57:07
What version of MSVC are you using?
The code was tested under VS2010, VS2008 MSVC6, and we didn't encounter
any issue with timeval. The only platform I am aware doesn't have it is
the WDK, which is addressed at line 99 in poll_windows.h , so if we
need to add any other platform, it should probably be done here.
Are you using WDK per chance? If that's the case, you may want to define
DDKBUILD when compiling.
If not, I would very much like to understand why your MSVC version
doesn't seem to define timeval, as it would be a bit surprising that,
since MSVC6 has it, a later version would not. Knowing the exact version
of Visual Studio you are using, and whether it was customized, would help.
From: Peter Stuge <peter@st...> - 2012-04-19 02:46:44
Garret Kelly wrote:
> I've been hitting an issue when compiling libusb under MSVC. The timeveal
> struct isn't defined in any of the included headers, despite being used all
> over the place, so I added an include to config.h to bring in Winsock2.h
> which has the definition. However, it also has a definition for the pollfd
> struct, so I've removed that from poll_windows.h.
> Is this an acceptable solution?
I think it is even a prefered solution over what we have now,
on the one condition that it works all the way back back to MSVC6
like the current code is supposed to. Can you check more detailed
into the situation for various different versions of MSC?