bug-ncurses
[Top][All Lists]
Advanced

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

Re: OK Macro Interference


From: Thomas Dickey
Subject: Re: OK Macro Interference
Date: Mon, 31 Aug 2020 20:53:46 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Aug 31, 2020 at 02:02:57PM -0700, Geoffrey Viola wrote:
> Hi,
> 
> I had some issues with include order due to macro definitions in the
> ncurses header file. I noticed that ncurses defines an OK macros and leaves
> it defined in
> https://github.com/mirror/ncurses/blob/a7e05fb9806cc1255b6ba4fb29e15d337f35b2ad/include/curses.h.in#L371.
> This causes some issues for functions that may want to be called OK:
> https://github.com/ApolloAuto/apollo/blob/master/cyber/state.h#L43. Would
> it be possible to change OK to NCURSES_OK? Another option that would work
> for me would be to undefine the OK macro outside of curses.h. Also, should
> the other macros follow? For example, there's TRUE, FALSE, and ERR.

no - the macros are standard for X/Open Curses, and SVr4 curses
(going back about 30 years).

If you have a symbol conflict, the way to deal with that is

        #include <curses.h>     (whereever that may be)
        #undef OK

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

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