"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: [PATCH 1/2] tog: fix widechar ncurses definitions
To:
Quentin Rameau <quinq@fifth.space>
Cc:
gameoftrees@openbsd.org
Date:
Tue, 21 Sep 2021 12:53:44 +0200

Download raw body.

Thread
On Sun, Sep 19, 2021 at 01:51:19PM +0200, Quentin Rameau wrote:
> The ncurses implementation still relies on _XOPEN_SOURCE_EXTENDED being
> defined in order to expose the widechar variant of ncurses, even on
> more recent distributed versions.
> ---
>  tog/tog.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tog/tog.c b/tog/tog.c
> index 228a76b0..5af8f69f 100644
> --- a/tog/tog.c
> +++ b/tog/tog.c
> @@ -19,7 +19,9 @@
>  
>  #include <ctype.h>
>  #include <errno.h>
> +#define _XOPEN_SOURCE_EXTENDED

The effect of this seems to be:
#define NCURSES_WIDECHAR 1

Can't we set this define directly?

>  #include <curses.h>
> +#undef _XOPEN_SOURCE_EXTENDED

I am not sure about the #undef; what if some other header below needs
this macro?

Perhaps this flag should rather be passed at build-time instead such that
it remains consistent across all C files?

 env CFLAGS="-D_XOPEN_SOURCE_EXTENDED" ./configure --prefix=...

>  #include <panel.h>
>  #include <locale.h>
>  #include <signal.h>