hi. just committed by nicm: List: openbsd-cvs Subject: CVS: cvs.openbsd.org: src From: Nicholas Marriott <nicm () cvs ! openbsd ! org> Date: 2022-10-10 8:57:10 Message-ID: 4f7d42a92ccdbaf3 () cvs ! openbsd ! org [Download RAW message or body]
CVSROOT: /cvs Module name: src Changes by: n...@cvs.openbsd.org 2022/10/10 03:03:08 Modified files: lib/libcurses : curses.h Log message: ncurses wide character functions should be available with _XOPEN_SOURCE of 500 or greater and not require _XOPEN_SOURCE_EXTENDED. Bring in changes from upstream ncurses patches 20100403 and 20111030 to take this into account. Reported by Grigory Kirillov via jmc@. On 10 September 2022 10:44:59 BST, Grigory Kirillov <t...@bk.ru> wrote: >On Fri, Sep 09, 2022 at 07:42:18PM +0200, Anders Andersson wrote: >> On Wed, Sep 7, 2022 at 9:02 PM Grigory Kirillov <t...@bk.ru> wrote: >> > >> > Recently one OpenBSD user of little project of mine got caught up in >> > a problem - they couldn't compile it from source because wide character >> > functions of the ncurses library weren't declared. After a long >> > investigation I finally found out that these functions require >> > _XOPEN_SOURCE_EXTENDED macro being defined. On my machine that wasn't >> > a problem because on my Linux system ncurses header also checks for >> > _XOPEN_SOURCE macro which value has to be greater than or equal to 500 >> > and I was already compiling it with this macro with a value of 700. >> > >> > My request here is to put up a `#define _XOPEN_SOURCE_EXTENDED` line to >> > the OpenBSD man page for curs_addwstr.3 I think this will make it >> > easier for other people to compile ncurses with wide character functions >> > especially for someone who's trying to resolve issues for someone else >> > while being on a different system... >> > >> > Also it would be cool if ncurses header provided in OpenBSD were >> > checking value of the _XOPEN_SOURCE macro (because >> > _XOPEN_SOURCE_EXTENDED is equal to _XOPEN_SOURCE with the value of 500 >> > or greater (according to my feature_test_macros(7) man page) and I also >> > hope that this is a standard behavior). >> >> From what I can see, this macro is obsolete, so it should probably not >> be recommended in the man page: >> >> "Use of _XOPEN_SOURCE_EXTENDED in new source code should be avoided. >> Since defining _XOPEN_SOURCE with a value of 500 or more has the same >> effect as defining _XOPEN_SOURCE_EXTENDED, the latter (obsolete) >> feature test macro is generally not described in the SYNOPSIS in man >> pages." >> > >Okay, then I hope someone kindly adds an ifdef with the _XOPEN_SOURCE >macro to the wide character function declarations in ncurses header. >I think it's also worth adding a note to the curs_addwstr.3 man page >about the need to declare the corresponding macro. Thanks! >