Re: [PATCH] Bug 3229: cf_gen.cc dependency removal / conversion to C++

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 09 Aug 2011 20:56:58 +1200

On 09/08/11 20:11, Kinkie wrote:
> On Tue, Aug 9, 2011 at 4:45 AM, Amos Jeffries wrote:
>>
>> This converts the bulk of cf_gen to C++ OOP code.
>
> Great! (even though my language of choice for converting cf_gen would
> be perl, not c++, but it makes no sense to rewrite too deeply what is
> working )

Yeah. But my perl-foo is not up to this level of complexity.

>
>> * char* tree members to std::string. Which eliminates xstrdup() and xis*()
>> calls.
>>
>> * structs to classes and replaces calloc/free with new/delete.
>>
>> * link cf_gen_depends.cci directly to autoconf.h defines.
>>
>> The result of these is that we can erase the dependencies on util.h,
>> time.cc, config.h, libcompat.la and libmisc.la. Directly fixing bug 3229 and
>> other related cross-compile issues that keep appearing on various OS.
>
> Great.
>
>> I'm not sure if we can also drop dependencies on XTRA_LIBS and MING_LIBS.
>> that would be nice. I've left them for now.
>
> I expect this can be done. After this is in it'll be trivial to test
> it on the build farm.
>
>> There is a bit further cleanup we can do. Replacing several classes with
>> std::list<std::string>.
>
> Nod.
>
> One point: on IRC Alex suggested we keep the #if HAVE_* guards around
> includes to ensure maximum compatibility.

Yes. I'm well aware of that benefit.

Unfortunately the problem is that configure on multi-arch systems
generates the HAVE_ to fit the target host environment, not the build
host. So for cf_gen (only) they are counter-productive.

  The one thing we seem to be able to rely on is the C++ stdlib headers
doing the compat stuff for us. So restricting the complexity of cf_gen
as much as possible to simple std:: functionality will improve portability.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.14
   Beta testers wanted for 3.2.0.10
Received on Tue Aug 09 2011 - 08:57:05 MDT

This archive was generated by hypermail 2.2.0 : Tue Aug 09 2011 - 12:00:03 MDT