lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] patch to include curses.h only for CLI code


From: Greg Chicares
Subject: Re: [lmi] patch to include curses.h only for CLI code
Date: Tue, 17 Jun 2008 19:25:34 +0000
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

On 2008-06-13 01:01Z, Vadim Zeitlin wrote:
> 
>  Currently the Linux build fails because platform_dependent.hpp includes
> curses.h which defines many macros with very common names. At least one of
> them, namely "border", conflicts with this innocently-looking code from
> wx/renderer.h:
> 
>     wxSplitterRenderParams(wxCoord widthSash_, wxCoord border_, bool isSens_)
>         : widthSash(widthSash_), border(border_), isHotSensitive(isSens_)
>         {
>         }
> 
> and the compilation fails with mysterious error
> 
> wx/renderer.h:82:48: error: macro "border" requires 8 arguments, but only 1 
> given

Shame on the maintainers of that library.

Thanks for presenting various options with thoughtful analysis.
The problem is bigger than a conflict between wx and curses:
it's curses versus the lawful universe. I might use a name like
'border' in code that does calculations independent of platform
or user interface. It could take tremendous effort to debug the
sort of errors this might cause. I'm inclined to avoid including
"curses.h" altogether, and just write
  extern "C" int getch();
where needed, with enough explanation that no one later tries to
"improve" the code by including that header again. That's mildly
distasteful, but I see no other guaranteed and permanent way to
banish the problem. What do you think? If you agree, then you
needn't write a patch....





reply via email to

[Prev in Thread] Current Thread [Next in Thread]