Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » Docking - Name clash with opencascade library
Docking - Name clash with opencascade library [message #27429] Sat, 17 July 2010 11:15 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
I've got a small problem with "struct Handle", private to DockCont, which name is identical to OpenCascade library Handle macro.

The quick solution would be to rename Handle to DockHandle, just few lines of code change and no external visibility, as Handle struct is private.

Mjrt, could you please apply it ? Or, I could commit it by myself if you agree.

Ciao

Max
Re: Docking - Name clash with opencascade library [message #27432 is a reply to message #27429] Sat, 17 July 2010 13:05 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
mdelfede wrote on Sat, 17 July 2010 11:15

I've got a small problem with "struct Handle", private to DockCont, which name is identical to OpenCascade library Handle macro.


Hello, Massimo.

It possible to use #pragma push_macro("SomeDefine") to save current defined value to macro stack and #pragma pop_macro("SomeDefine") to load saved value from macro stack.

For example:
#pragma push_macro("Handle")
#undef Handle
#include <Docking/Docking.h>
#pragma pop_macro("Handle")

Tested for GCC and MSC compilers.
Re: Docking - Name clash with opencascade library [message #27433 is a reply to message #27432] Sat, 17 July 2010 13:55 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Well, that could be a solution... I'll test it.
Anyways, I think it would be better to change the Handle struct name, it doesn't harm.

I know that's an OpenCascade fault, not a Docking one. OpenCascade has thousands of functions/structs/macros and no namespace....

Max
Re: Docking - Name clash with opencascade library [message #27434 is a reply to message #27433] Sat, 17 July 2010 14:57 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Another solution can be consolidation of used OpenCascade headers to include in separate header file, where you can #undef all clashed macros after using it. Then you can include that header file into application with Docking package.

This is generic suggestions to solve such problems.
Re: Docking - Name clash with opencascade library [message #27435 is a reply to message #27434] Sat, 17 July 2010 15:21 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Not possible, the Handle() macro is needed everywhere.... It's a sort of smart pointer system made with macro, sigh.
OpenCascade has some very old code parts in it.
It should be rewritten with more modern compilers in mind, but it would be a really huge task.

Anyways, I tested your method and it works too, so it's ok for me.
I was just testing a sketcher app using opencascade.

Ciao

Max
Re: Docking - Name clash with opencascade library [message #27448 is a reply to message #27435] Sun, 18 July 2010 10:01 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I don't mind changing it, as you say it's completely internal. I'll commit it when I get back to the office on Wednesday.
Re: Docking - Name clash with opencascade library [message #27450 is a reply to message #27448] Sun, 18 July 2010 12:06 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
mrjt wrote on Sun, 18 July 2010 10:01

I don't mind changing it, as you say it's completely internal. I'll commit it when I get back to the office on Wednesday.


Thank you very much Smile

Ciao

Max
Previous Topic: Docking: Bug Fix:
Next Topic: Scatter: Propose to add new callbacks
Goto Forum:
  


Current Time: Tue Apr 16 13:42:38 CEST 2024

Total time taken to generate the page: 0.02072 seconds