[Bf-committers] MacOS Compile Solved - WARNING

Douglas Toltzman bf-committers@blender.org
Sat, 27 Sep 2003 08:55:43 -0400 (EDT)


I did some namespace testing to see how it would affect the linker and I
discovered that declaring a function in a different namespace renames the
function (as one might expect).  Therefore, to use namespaces to solve our
problems with extern name conflicts, we'd have to wrap all of the blender
headers in "namespace bl { ... };" trappings and we'd have to do it in all
or most of the sources.  It sounded like a good idea when I was thinking
we could put the Quicktime headers inside of a "namespace QT { ... };"
wrapping and just do "using namespace QT;" where it was appropriate or
refer to QT structures as "QT::...".  Unfortunately, we'd need to be able
to recompile the QT code.

Along the same lines, but requireing a little more effort than a simple
"namespace" declaration, could we just create a QT wrapper file that lived
inside a "QT" namespace and provided the mapping from QT::xxx() functions
to the QT library functions?  I can explore this a little further, if it's
not a high priority.  I'll have some time next week.

I suppose we'd have to include #ifdefs to protect the entire mess from
compilers that don't support namespaces.  However, the QT code is
obviously localized to two environments (Win32 and Mac).  I'm thinking it
can be done in such a way that future conflicts can be avoided.

Douglas Toltzman


On Fri, 26 Sep 2003, Douglas Bischoff wrote:

> On Friday, September 26, 2003, at 03:42 PM, Douglas Toltzman wrote:
> 
> > What was the reason why we can't use namespaces to resolve these 
> > issues?
> 
> I am not familiar enough with namespace management and compiler 
> settings to have done so. Using #undef failed, as did attempting to 
> rename the item using typedef.
> 
> As I am apparently the only person who'd upgraded to gcc3.3 nobody else 
> is having these problems. Rob Haarsma did a great job of moving his 
> code to areas that weren't affected, but other problem areas persisted 
> that I could not solve.
> 
> Thanks for any help in nailing this down!
> 
> -Bish
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
> 

/*********************************************
 * Douglas Toltzman
 * President/CEO, Oak Street Software, Inc.
 * doug@oakstreetsoftware.com
 * http://www.oakstreetsoftware.com/
 *********************************************/