tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: use of the uniquely NetBSD _OPENBSD_SOURCE vs something better?
On Thu, May 08, 2025 at 11:54:24AM -0700, Greg A. Woods wrote:
> However this special define does impose extra effort to port code to
> specifically to NetBSD, as now strtonum() is more or less "universally"
> available by default. (I've since seen that it is available by default
> in Solaris (illumos, OmniOS), and of course it's also been in the linux
> "BSD" library, with default visibility, for a very long time now.)
>
> In any case it seems mostly like politics and bad grudges to require a
> unique special define to expose these functions to code that end users
> are just trying to build.
>
To be honest it's a long term policy on NetBSD to avoid namespace
pollution, we don't expose our own functions to POSIX applications
either.
libbsd is a random third-party project and not part of any libc.
> I'm going to get laughed at trying to suggest fixes to projects which
> effectively say they have to define "_OPENBSD_SOURCE" just to compile
> stuff on NetBSD when it already works on all the other BSDs!
>
> #if defined(__NetBSD__) && !defined(_OPENBSD_SOURCE)
> # define _OPENBSD_SOURCE 1
> #endif
This can (and should) be done via the build system or environment
instead. export CFLAGS="-D_OPENBSD_SOURCE", etc.
Home |
Main Index |
Thread Index |
Old Index