Re: Another new build problem on nt branch

From: Robert Collins <robertc@dont-contact.us>
Date: 11 Mar 2003 23:12:14 +1100

On Tue, 2003-03-11 at 22:42, Guido Serassio wrote:
> Hi,
>
> I have found a new build problem trying to build the nt branch:
>
> comm.cc:57:18: macro "connect" requires 3 arguments, but only 1 given
> comm.cc:57: variable or field `connect' declared void
...
> #define connect(s,n,l) squid_connect(s,n,l)

Yep, defines are generally evil and prone to breakage.

I take it that you need to replace calls to ::connect(a,b,c) in the
squid code with a call to :: squid_connect (a,b,c) ?

Well, one answer is:
namespace Squid {
inline int connect (s,n,l) {return squid_connect(s,n,l);}
};
(pesudoish code).

Then, in squid.h, add :
'using namespace Squid;

What this does is makes unguarded calls to a global connect(a,b,c) use
that inline function. Calls that need the original connect can use
::connect(a,b,c).

Cheers,
Rob

-- 
GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.

Received on Tue Mar 11 2003 - 05:12:22 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:32 MST