< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] u_int32_t


From: "Scott Godin" <slgodin@xxxxxxxxxxxx >
To: "stensil" <stensil@xxxxxxx>
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