]> git.ipfire.org Git - thirdparty/shadow.git/commit
Add bit manipulation functions
authorAlejandro Colomar <alx@kernel.org>
Fri, 30 Dec 2022 22:00:14 +0000 (23:00 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 28 Jan 2023 03:48:37 +0000 (21:48 -0600)
commit4a56f2baabd6c4ef3f485e9a5f7f3d4168a2d60b
treee6233bb8b06d7c193889f166f81022f77f29cabf
parentbe1f4f7972ad7ec151c31ad408083828bbdefd4b
Add bit manipulation functions

These functions implement bit manipulation APIs, which will be added to
C23, so that in the far future, we will be able to replace our functions
by the standard ones, just by adding the stdc_ prefix, and including
<stdbit.h>.

However, we need to avoid UB for an input of 0, so slightly deviate from
C23, and use a different name (with _wrap) for distunguishing our API
from the standard one.

Cc: Joseph Myers <joseph@codesourcery.com>
Cc: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/bit.h [new file with mode: 0644]
libmisc/Makefile.am
libmisc/bit.c [new file with mode: 0644]