Re: C++ errors building 3.HEAD on Windows

From: Robert Collins <robertc@dont-contact.us>
Date: Wed, 23 Jan 2008 20:57:09 +1100

On Wed, 2008-01-23 at 10:41 +1300, Amos Jeffries wrote:
> > Hi Alex,
> >
> > At 18:28 21/01/2008, Alex Rousskov wrote:
> >
> >>Please let me know if both of you get stuck with any specific error and
> >>I will try to help. FWIW, I doubt many Squid functions should be
> >>declared with C binding so we may just need to modify some old
> >>declarations to remove "extern C".
> >
> > Just this one left:
> >
> > depbase=`echo ACLARP.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; \
> > if g++ -DHAVE_CONFIG_H
> > -DDEFAULT_CONFIG_FILE=\"c:/mgw-3.0/etc/squid.conf\" -I. -I.
> > -I../include -I. -I. -I../include -I../include
> > -I../lib/libTrie/include -I/usr/include/libxml2 -Werror -Wall
> > -Wpointer-arith -Wwrite-strings -Wcomments -D_FILE_OFFSET_BITS=64 -g
> > -O2 -mthreads -MT ACLARP.o -MD -MP -MF "$depbase.Tpo" -c -o ACLARP.o
> > ACLARP.cc; \
> > then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit
> > 1; fi
> > ACLARP.cc: In function `int aclMatchArp(SplayNode<acl_arp_data*>**,
> > IPAddress&)':
> > ACLARP.cc:571: error: no matching function for call to
> > `in_addr::in_addr(DWORD&)'
> > d:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsock2.h:223:
> > note: candidates are: in_addr::in_addr()
> > d:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/winsock2.h:223:
> > note: in_addr::in_addr(const in_addr&)
> > make[3]: *** [ACLARP.o] Error 1
> >
> > I'm not able to do the correct type cast, please do you can help me ?
> >
>
> oh b*%%*r. This might be why the ACLARP originally used raw bytes instead
> of proper types.
> Are you able to add a cast it to DWORD->BYTE[4]->in_addr or
> DWORD->BYTE[4]->int->in_addr or even void* if those fail?
>
> I think we need to check the byte-order is not touched. It should be
> arriving as a network-order DWORD.

Thats likely a reason; I migrated the code to C++ without trying to
improve its specific style; just to fit it into the dynamic registered
acl type stuff.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Received on Wed Jan 23 2008 - 02:57:34 MST

This archive was generated by hypermail pre-2.1.9 : Wed Jan 30 2008 - 12:00:09 MST