yyyy3531614 / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Opcode pollutes global namespace #175

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Bullet in general, and Pierre Terdiman in particular. :)

I am using Opcode in my OgreOpcode library, and since Bullet svn seems to
be the closest thing to an Opcode in source control, I am using it as an
svn externals link in my own repository.

Problem is that I got "namespace leaks".
The Opcode namespace is behaving, but IceCore and IceMaths are misbehaving.
Which clashes with things like Ogre::Ray and Ogre::Plane, etc.
In peoples code, not my library.

I attach a patch, which fixes this with minimal mess.
It's basically wrapping the IceCore and IceMath namespaces in ICE_Hook in
an Opcode namespace, and then changing every using namespace
IceCore/IceMaths in cpp's.
There's a small change in OPC_HybridModel.cpp where I needed to rename the
local function ComputeMinMax to ComputeMinMax_HM, and then a small change
in OPC_OptimizedTree.cpp where ComputeMinMax became ComputeMinMax_OT.

A very sleek solution, don't you think?

Cheers

Jacob 'jacmoe' Moen

Original issue reported on code.google.com by jacmoe...@gmail.com on 18 Jan 2009 at 11:16

Attachments:

GoogleCodeExporter commented 9 years ago

Patch has been applied. It is, however, possible that future improvements by 
Pierre 
could overwrite it again.

http://code.google.com/p/bullet/source/detail?r=1608

Original comment by erwin.coumans on 6 Feb 2009 at 6:28