From MAILER-DAEMON Fri Aug 13 08:58:29 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Ojtq9-0002a9-IQ
	for mharc-bug-commoncpp@gnu.org; Fri, 13 Aug 2010 08:58:29 -0400
Received: from [140.186.70.92] (port=41083 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1OjckZ-00028k-2q
	for bug-commoncpp@gnu.org; Thu, 12 Aug 2010 14:43:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jbaurick@nvidia.com>) id 1OjckN-00029z-IC
	for bug-commoncpp@gnu.org; Thu, 12 Aug 2010 14:43:24 -0400
Received: from hqemgate04.nvidia.com ([216.228.121.35]:8022)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jbaurick@nvidia.com>) id 1OjckN-00029T-92
	for bug-commoncpp@gnu.org; Thu, 12 Aug 2010 14:43:23 -0400
Received: from hqnvupgp04.nvidia.com (Not Verified[172.20.161.48]) by
	hqemgate04.nvidia.com
	id <B4c643b850001>; Thu, 12 Aug 2010 11:20:53 -0700
Received: from hqemhub03.nvidia.com ([172.17.108.22])
	by hqnvupgp04.nvidia.com (PGP Universal service);
	Thu, 12 Aug 2010 11:23:18 -0700
X-PGP-Universal: processed;
	by hqnvupgp04.nvidia.com on Thu, 12 Aug 2010 11:23:18 -0700
Received: from HQMAIL03.nvidia.com ([172.17.200.13]) by hqemhub03.nvidia.com
	([172.20.150.15]) with mapi; Thu, 12 Aug 2010 11:23:17 -0700
From: Jason Baurick <jbaurick@nvidia.com>
To: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Date: Thu, 12 Aug 2010 11:22:49 -0700
Thread-Topic: Win7 Build Issue
Thread-Index: AQHLOktehON2XrdwaUu2om0wYXXeSw==
Message-ID: <E38DCE359E4BAD4B91FF60558E56302E18D6F04E28@HQMAIL03.nvidia.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
Content-Type: multipart/mixed;
	boundary="_002_E38DCE359E4BAD4B91FF60558E56302E18D6F04E28HQMAIL03nvidi_"
MIME-Version: 1.0
X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+
X-Mailman-Approved-At: Fri, 13 Aug 2010 08:58:28 -0400
Subject: Win7 Build Issue
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Aug 2010 18:43:37 -0000

--_002_E38DCE359E4BAD4B91FF60558E56302E18D6F04E28HQMAIL03nvidi_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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 secon=
d is that the u_long type and size_t type are not always the same on wind=
ows, so I introduced a temporary u_long to pass into ioctlsocket.  I've a=
lso 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()
=20		 error(errInput,(char *)"Error on retrieve the FIONREAD option.",soc=
ket_errno);
=20	 }
=20#else
-	if (ioctlsocket(so, FIOREAD, &readsize)){
+    u_long size =3D 0;
+
+	if (ioctlsocket(so, FIONREAD, &size)){
=20		error(errInput,(char *)"Error on retrieve the FIONREAD option.",sock=
et_errno);
=20	}
+
+    readsize =3D size;
=20#endif
=20	return readsize;
=20}

- Jason
-------------------------------------------------------------------------=
----------
This email message is for the sole use of the intended recipient(s) and m=
ay contain
confidential information.  Any unauthorized review, use, disclosure or di=
stribution
is prohibited.  If you are not the intended recipient, please contact the=
=20sender by
reply email and destroy all copies of the original message.
-------------------------------------------------------------------------=
----------

--_002_E38DCE359E4BAD4B91FF60558E56302E18D6F04E28HQMAIL03nvidi_
Content-Type: application/octet-stream; name="win_build.patch"
Content-Description: win_build.patch
Content-Disposition: attachment; filename="win_build.patch"; size=516;
	creation-date="Thu, 12 Aug 2010 11:23:01 GMT";
	modification-date="Thu, 12 Aug 2010 11:23:01 GMT"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL3NyYy9zb2NrZXQuY3BwIGIvc3JjL3NvY2tldC5jcHAKaW5kZXggOWZhZmI5
MS4uOTU1YzFlMiAxMDA2NDQKLS0tIGEvc3JjL3NvY2tldC5jcHAKKysrIGIvc3JjL3NvY2tldC5j
cHAKQEAgLTI4NTMsOSArMjg1MywxMyBAQCBzaXplX3QgIERDQ1BTb2NrZXQ6OmF2YWlsYWJsZSgp
CiAJCSBlcnJvcihlcnJJbnB1dCwoY2hhciAqKSJFcnJvciBvbiByZXRyaWV2ZSB0aGUgRklPTlJF
QUQgb3B0aW9uLiIsc29ja2V0X2Vycm5vKTsKIAkgfQogI2Vsc2UKLQlpZiAoaW9jdGxzb2NrZXQo
c28sIEZJT1JFQUQsICZyZWFkc2l6ZSkpeworICAgIHVfbG9uZyBzaXplID0gMDsKKworCWlmIChp
b2N0bHNvY2tldChzbywgRklPTlJFQUQsICZzaXplKSl7CiAJCWVycm9yKGVycklucHV0LChjaGFy
ICopIkVycm9yIG9uIHJldHJpZXZlIHRoZSBGSU9OUkVBRCBvcHRpb24uIixzb2NrZXRfZXJybm8p
OwogCX0KKworICAgIHJlYWRzaXplID0gc2l6ZTsKICNlbmRpZgogCXJldHVybiByZWFkc2l6ZTsK
IH0K

--_002_E38DCE359E4BAD4B91FF60558E56302E18D6F04E28HQMAIL03nvidi_--


From MAILER-DAEMON Fri Aug 13 09:06:17 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Ojtxh-0004DM-22
	for mharc-bug-commoncpp@gnu.org; Fri, 13 Aug 2010 09:06:17 -0400
Received: from [140.186.70.92] (port=48710 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Ojtxb-0004CW-SV
	for bug-commoncpp@gnu.org; Fri, 13 Aug 2010 09:06:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <dyfet@gnutelephony.org>) id 1OjtxX-0005gI-Ro
	for bug-commoncpp@gnu.org; Fri, 13 Aug 2010 09:06:11 -0400
Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:56513)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <dyfet@gnutelephony.org>) id 1OjtxX-0005g7-Po
	for bug-commoncpp@gnu.org; Fri, 13 Aug 2010 09:06:07 -0400
Received: from [108.25.61.177] (helo=[172.16.59.91])
	by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
	(Exim 4.68) (envelope-from <dyfet@gnutelephony.org>)
	id 1OjtxW-000ENO-Gk; Fri, 13 Aug 2010 13:06:06 +0000
X-Mail-Handler: MailHop Outbound by DynDNS
X-Originating-IP: 108.25.61.177
X-Report-Abuse-To: abuse@dyndns.com (see
	http://www.dyndns.com/services/mailhop/outbound_abuse.html for
	abuse reporting information)
X-MHO-User: U2FsdGVkX1/ZRxrM85xjzNTzMrywGoGB
Message-ID: <4C65433E.50000@gnutelephony.org>
Date: Fri, 13 Aug 2010 09:06:06 -0400
From: David Sugar <dyfet@gnutelephony.org>
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
MIME-Version: 1.0
To: Jason Baurick <jbaurick@nvidia.com>
References: <E38DCE359E4BAD4B91FF60558E56302E18D6F04E28@HQMAIL03.nvidia.com>
In-Reply-To: <E38DCE359E4BAD4B91FF60558E56302E18D6F04E28@HQMAIL03.nvidia.com>
X-Enigmail-Version: 1.0.1
Content-Type: multipart/mixed; boundary="------------060707010402080905010403"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
Cc: "bug-commoncpp@gnu.org" <bug-commoncpp@gnu.org>
Subject: Re: Win7 Build Issue
X-BeenThere: bug-commoncpp@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for Common C++ <bug-commoncpp.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-commoncpp>
List-Post: <mailto:bug-commoncpp@gnu.org>
List-Help: <mailto:bug-commoncpp-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-commoncpp>,
	<mailto:bug-commoncpp-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Aug 2010 13:06:16 -0000

This is a multi-part message in MIME format.
--------------060707010402080905010403
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

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

--------------060707010402080905010403
Content-Type: text/x-vcard; charset=utf-8;
 name="dyfet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="dyfet.vcf"

begin:vcard
fn:David Sugar
n:Sugar;David
org:GNU Telephony
email;internet:dyfet@gnutelephony.org
tel;work:+1 609 465 5336
url:http://www.gnutelephony.org
version:2.1
end:vcard


--------------060707010402080905010403--


