[Issue 23513] ImportC doesn't export ncurses' attributes (C macros)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 10 06:44:58 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23513

--- Comment #2 from Tomas Ortin Fernandez <quanrong at mailbox.org> ---
This is the definition:

#define A_BOLD          NCURSES_BITS(1U,13)

And NCURSES_BITS is defined as follows:

#define NCURSES_BITS(mask,shift) (NCURSES_CAST(chtype,(mask)) << ((shift) +
NCURSES_ATTR_SHIFT))

NCURSES_CAST is defined as:

#ifdef __cplusplus
extern "C" {
#define NCURSES_CAST(type,value) static_cast<type>(value)
#else
#define NCURSES_CAST(type,value) (type)(value)
#endif

And NCURSES_ATTR_SHIFT is just 8

I'm using the stable version of this implementation (I can attach the .h file
if it's better) https://invisible-island.net/ncurses/ncurses.html

Note that it doesn't just happen with A_BOLD, it happens with all the ncurses
"character attributes".

--


More information about the Digitalmars-d-bugs mailing list