On Sat, 28 Dec 2019, Jonathan Gray wrote:
> On Sat, Dec 28, 2019 at 05:08:51PM -0500, Thomas Dickey wrote:
> > On Thu, Dec 26, 2019 at 05:12:56PM -0500, Thomas Dickey wrote:
...
> > That's okay.  But there's an error in OpenBSD's header files which 
> > I'll have to work around for the time being.  It would be nice if 
> > someone fixed it:
> > 
> > /usr/include/ctype.h has
> > 
> > #if __POSIX_VISIBLE >= 200809
> > #ifndef _LOCALE_T_DEFINED_
> > #define _LOCALE_T_DEFINED_
> > typedef void    *locale_t;
> > #endif
> > #endif
> > 
> > and (since ncurses uses no feature newer than this) my default build
> > does this:
> > 
> >     -D_BSD_SOURCE -D_XOPEN_SOURCE=600
> 
> defining _XOPEN_SOURCE=600 results in __POSIX_VISIBLE 200112
> defining _XOPEN_SOURCE=700 results in __POSIX_VISIBLE 200809
> when not defining anything you'll get __POSIX_VISIBLE 200809
> 
> So if you want it to be visible either don't do any visibility
> defines, use _XOPEN_SOURCE=700 or _POSIX_C_SOURCE=200809.

Thomas's point is that our c++ <iostream> unconditionally pulls in 
<support/xlocale/__strtonum_fallback.h> and <__locale> and perhaps others 
which unconditionally use locale_t, despite locale_t being conditionally 
defined.

So, when did C++ start permitting and/or requiring locale_t to be 
provided?

One or more of these is presumably then true:
 a) our C++ headers need #if's to skip all locale_t stuff when you select 
    an environment before locale_t was added
 b) our <ctype.h> header needs to broaden its conditional to go ahead and
    provide locale_t (and the functions?) when in a C++ environment that 
    should have them


Philip Guenther

Reply via email to