freebsd-nq/lib
Stefan Eßer 5e04571cf3 sys/bitset.h: reduce visibility of BIT_* macros
Add two underscore characters "__" to names of BIT_* and BITSET_*
macros to move them to the implementation name space and to prevent
a name space pollution due to BIT_* macros in 3rd party programs with
conflicting parameter signatures.

These prefixed macro names are used in kernel header files to define
macros in e.g. sched.h, sys/cpuset.h and sys/domainset.h.

If C programs are built with either -D_KERNEL (automatically passed
when building a kernel or kernel modules) or -D_WANT_FREENBSD_BITSET
(or this macros is defined in the source code before including the
bitset macros), then all macros are made visible with their previous
names, too. E.g., both __BIT_SET() and BIT_SET() are visible with
either of _KERNEL or _WANT_FREEBSD_BITSET defined.

The main reason for this change is that some 3rd party sources
including sched.h have been found to contain conflicting BIT_*
macros.

As a work-around, parts of shed.h have been made conditional and
depend on _WITH_CPU_SET_T being set when sched.h is included.
Ports that expect the full functionality provided by sched.h need
to be built with -D_WITH_CPU_SET_T. But this leads to conflicts if
BIT_* macros are defined in that program, too.

This patch set makes all of sched.h visible again without this
parameter being passed and without any name space pollution due
to BIT_* macros becoming visible when sched.h is included.

This patch set will be backported to the STABLE branches, but ports
will need to use -D_WITH_CPU_SET_T as long as there are supported
releases that do not contain these patches.

Reviewed by:	kib, markj
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D33235
2021-12-05 23:00:25 +01:00
..
atf Do not build libatf-c++ when WITHOUT_CXX 2021-10-29 10:08:24 -04:00
clang Merge llvm-project 13.0.0 release 2021-11-13 21:49:29 +01:00
csu Add arm64 ifunc support in static binaries 2021-08-23 13:39:09 +00:00
flua jail(3lua): add jail.attach()/jail.remove() methods 2021-09-30 16:31:04 -05:00
geom geli(8): Do not report error on resize to the same size. 2021-08-18 17:11:03 -04:00
googletest googletest: Silence warnings about deprecated implicit copy constructors 2021-08-26 22:06:53 +02:00
lib9p lib9p: fix building on systems without capser 2021-01-04 20:48:48 +01:00
lib80211 lib80211: Start adding 11ac ETSI bits to regdomain.xml 2021-03-18 11:09:10 +00:00
libalias Rename NO_WERROR -> MK_WERROR=no 2021-01-07 09:31:03 +00:00
libarchive libarchive: import changes from upstream 2021-08-23 03:07:36 +02:00
libauditd
libbe zfs: unbreak build broken in 160388166 2021-06-08 22:21:11 +02:00
libbearssl
libbegemot
libblacklist
libblocksruntime
libbluetooth bluetooth: Remove one more h4 reference. 2021-09-29 22:02:25 -06:00
libbsddialog bsddialog: actually add directories 2021-11-24 12:13:45 +01:00
libbsdstat
libbsm
libbsnmp pkgbase: Put the mibs and defs in the bnsmp package 2021-06-19 17:50:03 +02:00
libbz2
libc swapoff(2): document extended syscall arguments 2021-12-05 00:20:58 +02:00
libc_nonshared
libc++ Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a 2021-11-13 21:42:03 +01:00
libc++experimental Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a 2021-11-13 21:42:03 +01:00
libcalendar
libcam libcam: Define depop structures and introduce scsi_wrap 2021-09-20 16:27:59 -06:00
libcapsicum
libcasper Fix two more nits from 0mp 2021-11-10 13:09:19 -05:00
libcbor Add libcbor to the build 2021-10-15 15:10:24 -04:00
libclang_rt Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a 2021-11-13 21:42:03 +01:00
libcom_err pkgbase: Create a FreeBSD-kerberos package 2021-09-07 10:23:14 +02:00
libcompat
libcompiler_rt Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a 2021-11-13 21:42:03 +01:00
libcrypt
libcuse
libcxxrt
libdevctl
libdevdctl Fix race in case of device destruction. 2021-04-13 11:25:27 -04:00
libdevinfo
libdevstat
libdl libc: include rtld.h into static implementations of rtld interface 2021-04-09 23:46:24 +03:00
libdpv libdialog: Bump shared library version to 10. 2021-10-27 09:30:24 -07:00
libdwarf
libedit ncurses: chase dependency changes in the source tree 2021-10-04 11:38:24 +02:00
libefivar pkgbase: Remove libefivar package and add a efi-tools one 2021-09-07 10:24:21 +02:00
libelf libelf: Link gelf_getchdr.3 to the build 2021-11-29 13:57:24 -05:00
libelftc
libevent1
libexecinfo
libexpat pkgbase: Put libbsdxml in FreeBSD-runtime 2021-09-07 10:22:45 +02:00
libfetch fetch: do not confuse capacity and length 2021-09-09 16:51:26 +02:00
libfido2 Add libfido2 to the build 2021-10-22 19:57:57 -04:00
libfigpar
libgcc_eh Add build system support for ASAN+UBSAN instrumentation 2021-08-02 14:33:24 +01:00
libgcc_s libgcc_s: Export 64-bit int to 128-bit float functions 2021-10-03 19:34:25 +01:00
libgeom [skip ci] correct a few SPDX license tags 2021-07-07 13:52:20 -06:00
libgpio
libgssapi Remove __NO_TLS. 2021-02-23 20:08:10 +02:00
libiconv_modules
libifconfig libifconfig: Overhaul ifconfig_media_* interfaces 2021-03-05 04:15:55 -05:00
libipsec ipsec_set_policy(3): fix sentence 2021-08-10 03:46:35 +03:00
libipt
libjail
libkiconv libkiconv: address memory leak in not-found cases 2021-04-22 19:32:34 -04:00
libkvm libkvm: Fix build after removeal of p_tracevp 2021-05-22 16:36:54 +03:00
libldns
liblua contrib/lua: update to 5.4.2 2021-01-13 23:56:18 -06:00
liblutok
liblzma Convert libs with pc files to use PCFILES 2021-03-16 07:13:07 +01:00
libmagic Convert libs with pc files to use PCFILES 2021-03-16 07:13:07 +01:00
libmd Revert "Disable the accelerated arm64 sha25 in static libraries" 2021-08-30 10:36:43 +01:00
libmemstat sys/bitset.h: reduce visibility of BIT_* macros 2021-12-05 23:00:25 +01:00
libmilter
libmixer mixer: make .Dt tags uppercase 2021-11-20 08:58:36 +01:00
libmp
libmt Add the LTO-9 density code to libmt and the mt(1) man page. 2020-12-10 21:06:06 +00:00
libnetbsd
libnetgraph Retire synchronous PPP kernel driver sppp(4). 2021-10-22 11:41:36 -07:00
libnetmap libnetmap: reset errno in nmreq_register_decode() 2021-04-02 14:31:57 +00:00
libngatm
libnv libpfct: Fix PIC flag 2021-04-17 22:10:13 +02:00
libomp Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a 2021-11-13 21:42:03 +01:00
libopenbsd
libopencsd
libopie
libpam openssh: update to OpenSSH v8.7p1 2021-09-07 21:05:51 -04:00
libpathconv
libpcap
libpe
libpfctl pf tests: Test PR259689 2021-11-10 11:27:22 +01:00
libpjdlog
libpmc libpmc: Update some x86 event definitions. 2021-11-25 11:19:26 -05:00
libpmcstat pmcstat: fix PPC kernel symbol resolution 2020-11-05 16:47:23 +00:00
libproc Remove the MK_LIBCPLUSPLUS option 2021-02-01 09:32:07 +00:00
libprocstat procstat_getfiles_sysctl: do not require non-null ki_fd 2021-12-03 00:52:49 +02:00
libradius libradius: fix WITHOUT_OPENSSL build 2021-10-28 17:05:53 -04:00
libregex pkgbase: Remove FreeBSD-libregex package 2021-09-07 10:23:53 +02:00
librpcsec_gss
librpcsvc
librss
librt Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. 2021-08-22 23:49:23 +12:00
librtld_db librtld_db: Handle shlibs with discontiguous mappings. 2021-12-03 11:07:30 -08:00
libsbuf
libsdp
libsecureboot libsecureboot: define SOPEN_MAX 2021-08-10 22:46:40 +03:00
libsm
libsmb
libsmdb
libsmutil
libsqlite3
libssp
libssp_nonshared
libstats
libstdbuf
libstdthreads
libsysdecode sysdecode_enum.3: Fix a typo: SIGBTRAP -> SIGTRAP. 2021-10-05 14:55:18 -07:00
libtacplus
libtelnet
libthr libthr: Use kern.stacktop for thread stack calculation. 2021-10-15 10:21:56 +02:00
libthread_db
libucl
libufs Consolodate four copies of the STDSB define into a single place. 2021-11-14 22:10:16 -08:00
libugidfw
libulog
libunbound
libusb Improve handling of USB device re-open in the LibUSB v1.x API. 2021-06-11 17:06:44 +02:00
libusbhid
libutil libutil: add kinfo_getswapvmobject(3) 2021-10-26 15:50:29 +03:00
libveriexec
libvgl
libvmmapi Remove an always-true check. 2021-09-15 09:03:17 -07:00
libwrap
libxo add blank line between variables (testing git commit) 2021-08-04 16:56:55 -04:00
liby
libypclnt
libz Convert libs with pc files to use PCFILES 2021-03-16 07:13:07 +01:00
libzstd libprivatezstd: Restrict symbol visibility similar to upstream 2021-01-03 11:26:46 -08:00
msun Use a builtin where possible in msun 2021-11-19 11:40:46 +00:00
ncurses ncurses: to not create a libncursesw.a in the OBJDIR 2021-11-24 11:02:22 +01:00
ofed Fix ibnd_* manpages sources 2021-02-18 15:59:34 +01:00
tests
Makefile bsddialog, mark the lib as dependent on ncurses 2021-11-24 16:48:44 +01:00
Makefile.inc