[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: _POSIX_C_SOURCE & _XOPEN_SOURCE standards conformance level macros
From: |
Thomas Dickey |
Subject: |
Re: _POSIX_C_SOURCE & _XOPEN_SOURCE standards conformance level macros |
Date: |
Sun, 20 Nov 2016 17:38:29 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Nov 13, 2016 at 10:41:07AM -0700, John Hein wrote:
>
> On FreeBSD, when using the ncurses port, pkg-config --cflags ncurses gives:
>
> -I/usr/local/include -I/usr/local/include/ncurses -D_BSD_TYPES
> -D__BSD_VISIBLE -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600
>
> If you then use those flags to compile a program that happens to use
> ncurses, it will force your code to conform to that level of standards
> conformance.
>
> Why would code that includes ncurses headers want or need to use
> _VISIBLE -D_POSIX_C_SOURCE=200112L and/or _XOPEN_SOURCE=600?
short: I generated the pc-files using the #define's which I used to
build ncurses.
long: It would be nice (perhaps) to postprocess that by pruning away
things that aren't necessary for compiling a client of the library.
That might be hard (since you get into combinations of definitions,
compilers that refuse to give error-exits on missing prototypes,
and weak-bindings that don't detect whether a function actually exists...)
Also, since I share those configure-checks across other programs, you
may find something not needed for ncurses in particular.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature