bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Win7 Build Issue


From: David Sugar
Subject: Re: Win7 Build Issue
Date: Fri, 13 Aug 2010 09:06:06 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6

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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-commoncpp

Attachment: dyfet.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]