cURL / Mailing Lists / curl-library / Single Mail

curl-library

Common files for libcurl and cares

From: Yang Tse <yangsita_at_gmail.com>
Date: Thu, 27 Jul 2006 19:29:23 +0200

Hi Daniel, et al ;-)

In order to get some things a little bit more uniform I would like to
use macros sread() and swrite() in cares as they are being used right
now in curl. But I encounter a small problem as I would like to do it.

Macros sread() and swrite() are defined in lib/setup.h so the natural
thing would be to define them in the same way in ares/setup.h or even
in ares/ares_private.h but the problem is that for debug builds
ares/ares_private.h pulls lib/memdebug.h and this one pulls
lib/setup.h so sread() and swrite() would be redefined generating
warnings at compile time.

One solution would just be to check if they are already defined. But I
don't like this approach very much since in the end there will be much
more stuff that should be common to libcurl and cares and would
require multiple checks.

I would prefer to have a single file, lets call it common-deps.h,
common-setup.h or something similar, that could be pulled both from
libcurl and from cares in a way that it would only be actually
included once even when pulled via lib/memdebug.h

Obviously the problem is that for stand alone distributions of cares
is should be available, and the same for libcurl ones. So it seems
that it should be located as ares/common-deps.h and also as
lib/common-deps.h. Taking into account that its contents should be the
same and always in sync it would make sense that they actually were
the same file with two different paths in CVS.

Is it possible to achive this ?

Or any better or more simple setup ?

I hope this makes some sense.

-- 
-=[Yang]=-
Received on 2006-07-27