freebsd-dev/sbin/pfctl
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
..
tests pfctl tests: Test fairq configuration 2021-05-20 14:06:23 +02:00
Makefile pfctl: Move ioctl abstraction functions into libpfctl 2021-04-10 11:16:02 +02:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
parse.y pf: Introduce ridentifier 2021-11-05 09:39:56 +01:00
pf_print_state.c pfctl: cache getprotobynumber results 2021-07-01 21:31:45 +00:00
pf_ruleset.c pf: match keyword support 2021-07-17 12:01:08 +02:00
pf.os Move pf.os to sbin/pfctl/ 2018-08-11 13:58:26 +00:00
pfctl_altq.c sys/bitset.h: reduce visibility of BIT_* macros 2021-12-05 23:00:25 +01:00
pfctl_ioctl.h pfctl: Move ioctl abstraction functions into libpfctl 2021-04-10 11:16:02 +02:00
pfctl_optimize.c libpfctl: Switch to pfctl_rule 2021-04-10 11:16:02 +02:00
pfctl_osfp.c pfctl: Make most global variables static. 2016-08-04 19:24:44 +00:00
pfctl_parser.c pf: Introduce ridentifier 2021-11-05 09:39:56 +01:00
pfctl_parser.h sys/bitset.h: reduce visibility of BIT_* macros 2021-12-05 23:00:25 +01:00
pfctl_qstats.c Extended pf(4) ioctl interface and pfctl(8) to allow bandwidths of 2018-08-22 19:38:48 +00:00
pfctl_radix.c pfctl: Warn users when they run into kernel limits 2019-12-14 02:03:47 +00:00
pfctl_table.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pfctl.8 pf: Support killing 'matching' states 2021-05-07 22:13:31 +02:00
pfctl.c pfctl: delay label macro expansion until after rule optimisation 2021-10-15 22:19:45 +02:00
pfctl.h pfctl: delay label macro expansion until after rule optimisation 2021-10-15 22:19:45 +02:00