I would be happy to take this patch in for the next release. I will also have to see if this applies to ucommon. I see there we currently have:
#ifdef _MSWINDOWS_
unsigned Socket::pending(socket_t so)
{
u_long opt;
if(so == INVALID_SOCKET)
return 0;
ioctlsocket(so, FIONREAD, &opt);
return (unsigned)opt;
}
So it looks like this already got sorted out there at some point, but
not I gather in commoncpp.
On 08/12/2010 02:22 PM, Jason Baurick wrote:
> I ran into a small windows build issue, below is the patch which fixes it.
> Basically there are two issues, first FIOREAD is undefined. The second is
> that the u_long type and size_t type are not always the same on windows, so I
> introduced a temporary u_long to pass into ioctlsocket. I've also attached
> the patch.
>
> diff --git a/src/socket.cpp b/src/socket.cpp
> index 9fafb91..955c1e2 100644
> --- a/src/socket.cpp
> +++ b/src/socket.cpp
> @@ -2853,9 +2853,13 @@ size_t DCCPSocket::available()
> error(errInput,(char *)"Error on retrieve the FIONREAD
> option.",socket_errno);
> }
> #else
> - if (ioctlsocket(so, FIOREAD, &readsize)){
> + u_long size = 0;
> +
> + if (ioctlsocket(so, FIONREAD, &size)){
> error(errInput,(char *)"Error on retrieve the FIONREAD
> option.",socket_errno);
> }
> +
> + readsize = size;
> #endif
> return readsize;
> }
>
> - Jason
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may
> contain
> confidential information. Any unauthorized review, use, disclosure or
> distribution
> is prohibited. If you are not the intended recipient, please contact the
> sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/bug-commoncpp
<<attachment: dyfet.vcf>>
_______________________________________________ Bug-commoncpp mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-commoncpp
