The problem is that it is very easy to use Rectangle and the fact that
it does not compile on Windows is not noticed until it is tried.
It sounds like a fix would be to replace "using namespace fltk" with
"namespace fltk {" (and a matching } at the end) in the source files.
Although again this probably won't be done until it is noticed when
compiling on Windows.
The other thing that helps is to rearrange the code so that windows.h is
included as little as possible.
Sanel Zukan wrote:
> I'm thinking about two possible solutions here (plus a sick one):
>
> - explicitly say fltk::Rectangle event if 'using namespace fltk' is
> stated (how is this portable among compilers? what about older
> compilers?). Ugly.
>
> - let preprocessor do the job, like:
> #define Rectangle MyRectangle
> // fltk headers
> #undef Rectangle
> // Win/OSX headers
>
> Very ugly (and code reference tools like ctags or studio will go crazy).
>
> - abolish fltk namespace and rewrite everything to good old Fl_
> (someone will kill me for this :)). No more ambiguities in the future.
>
> --
> Sanel
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev