Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Nov 2021 13:51:00 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        "freebsd-toolchain@FreeBSD.org" <freebsd-toolchain@freebsd.org>
Subject:   How to enable BSD defined names / functions
Message-ID:  <CANCZdfoLO6=A%2B1nm-eQvJCX4age2r0VU7CeiCL99mg6YvReEsQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--00000000000014bd1b05d152abc8
Content-Type: text/plain; charset="UTF-8"

There's rather a lot of software that defines _POSIX_C_SOURCE to some value
(usually 200809L for POSIX-1.2008), but also wants to use other things.

One can generally work around this issue by defining __BSD_VISIBLE=1, but
most other systems have something more specific. NetBSD has _NETBSD_SOURCE.
OpenBSD has _OPENBSD_SOURCE as well. There's also some expectation that
_BSD_SOURCE can be defined, but none of the currently active BSDs has that.

It appears from casual inspection that _NETBSD_SOURCE=1 means approximately
the same as __BSD_VISIBLE=1 in FreeBSD.

Would it make sense to add a _FREEBSD_SOURCE=1 case and have it include
__BSD_VISIBLE=1 regardless  of what other macros (especially
_POSIX_C_SOURCE) are defined to be a more regimented and defined way to
expand the namespace when multiple namespaces are defined?

Warner

--00000000000014bd1b05d152abc8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoLO6=A%2B1nm-eQvJCX4age2r0VU7CeiCL99mg6YvReEsQ>