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
..
2021-11-13 21:49:29 +01:00
2021-01-07 09:31:03 +00:00
2020-04-19 02:20:39 +00:00
2020-07-19 23:56:19 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2020-04-19 02:18:40 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2021-11-10 13:09:19 -05:00
2021-10-15 15:10:24 -04:00
2019-12-11 17:37:53 +00:00
2020-09-11 13:28:37 +00:00
2019-12-11 17:37:53 +00:00
2020-08-04 21:09:36 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2021-10-22 19:57:57 -04:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2021-02-23 20:08:10 +02:00
2019-12-11 17:37:53 +00:00
2021-01-13 23:56:18 -06:00
2019-12-11 17:37:53 +00:00
2021-11-20 08:58:36 +01:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2021-04-17 22:10:13 +02:00
2020-09-11 13:28:37 +00:00
2020-06-17 10:42:20 +00:00
2019-12-11 17:37:53 +00:00
2021-09-07 21:05:51 -04:00
2020-10-09 19:12:44 +00:00
2019-12-21 21:01:03 +00:00
2021-11-10 11:27:22 +01:00
2021-02-01 09:32:07 +00:00
2020-10-09 19:12:44 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2020-09-11 13:28:37 +00:00
2020-05-21 01:55:35 +00:00
2019-12-11 17:37:53 +00:00
2020-05-21 21:00:46 +00:00
2019-12-11 17:37:53 +00:00
2021-09-15 09:03:17 -07:00
2019-12-11 17:37:53 +00:00
2019-12-11 17:37:53 +00:00
2021-11-19 11:40:46 +00:00
2021-02-18 15:59:34 +01:00