[Spatialindex] Namespace use request
mhadji at gmail.com
Tue Oct 20 16:59:03 EEST 2009
Should we rename uint*_t to si_uint*_t or something?
Mateusz Loskot wrote:
> I was trying to report a bug to the SpatialIndex Trac but it's read only
> for me, even after I've registered and logged in.
> The spatialindex is a troublemaker. It pollutes global namespace with
> its own definitions of types and it uses very common names for this
> types. These definitions seriously breaks compilation of client's code
> that use different definitions of such aliases. Meaning, the
> SpatialIndex defines the following aliases in Tools.h in global namespace:
> typedef __int8 int8_t;
> typedef __int16 int16_t;
> typedef __int32 int32_t;
> typedef __int64 int64_t;
> typedef unsigned __int8 uint8_t;
> typedef unsigned __int16 uint16_t;
> typedef unsigned __int32 uint32_t;
> typedef unsigned __int64 uint64_t;
> It clashes with for example boost::uint* and boost::int* types,
> with liblas::uint* and liblas::int* types as well as with other
> definitions like stdint.h.
> For example, even if a client use his own types in properly
> namespaced code:
> namespace boost
> uint32_t a;
> SpatialIndex' types cause conflict or a full qualificatoin is required.
> Elements of SpatialIndex should be defined in namespace or rename all
> its integral types using unique names.
> Best regards,
More information about the Spatialindex