[reSIProcate] u_int32_t

Alan Stokes alan at alanstokes.org.uk
Thu Oct 20 04:29:45 CDT 2005


>
> From: "Scott Godin" <slgodin at icescape.com>
> To: "stensil" <stensil at list.ru>
> Date: Wed, 19 Oct 2005 09:21:45 -0400
> Subject: RE: [reSIProcate] u_int32_t
> OK - done now! I changed the usages of u_int32_t in BerkleyDB.cxx to
> grab u_int32_t from global scope (ie. ::u_int32_t) - hopefully this is
> OK for all platforms.
>
>
I don't think that will work on any standard C++ compiler.

Given:

typedef xxx u_int32_t;
namespace resip { typedef xxx u_int32_t; }
using namespace resip;

Then "::u_int32_t" is ambiguous - your using directive made the resip one
visible in the global namespace, so there's no way to tell which of the two
you mean.

All you can do (assuming the Berkley DB one can't be moved into a namespace)
is to delete the "using namespace resip;" and replace it with either
explicit resip:: qualifications everywhere, or a sprinkling of "using
resip::foo;" declarations. (Where foo != u_int32_t.)

(Use of using directives is best avoided in general for this sort of
reason.)

- Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20051020/fefff994/attachment.htm>


More information about the resiprocate-devel mailing list