Skip to content

Commit 8abb829

Browse files
committed
docs: Add stdbit.h to libc index and legacy README.
Add stdbit.h to the libc index and legacy README so that the new stdbit.h header is discoverable in the documentation and listed alongside other libc headers. Signed-off-by: Arjav Patel <arjav1528@gmail.com>
1 parent c501f78 commit 8abb829

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Documentation/components/libs/libc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ functions. So we have::
5252
search - search.h
5353
semaphore - semaphore.h
5454
stdio - stdio.h
55+
stdbit - stdbit.h (C23, optional; see CONFIG_ARCH_STDBIT_H / CONFIG_LIBC_STDBIT_GENERIC)
5556
stdlib - stdlib.h
5657
string - string.h (and legacy strings.h and non-standard nuttx/b2c.h)
5758
time - time.h

Documentation/legacy_README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,25 @@ you can use an architecture-specific `stdarg.h` header file by defining
819819
See the discussion above for the `math.h` header. This setting works
820820
exactly the same for the `stdarg.h` header file.
821821

822+
### stdbit.h (C23)
823+
824+
The C23 ``stdbit.h`` header provides bit-manipulation macros (leading/trailing
825+
zeros and ones, count, bit width, bit floor/ceil, endianness, etc.). NuttX
826+
keeps a redirecting header at ``include/nuttx/lib/stdbit.h``.
827+
828+
* **CONFIG_ARCH_STDBIT_H**: Enable when the architecture provides
829+
``arch/<architecture>/include/stdbit.h``. The architecture must select
830+
``ARCH_HAVE_STDBIT_H`` in its Kconfig. The build then copies
831+
``include/nuttx/lib/stdbit.h`` to ``include/stdbit.h``, which includes the
832+
architecture-specific header.
833+
* **CONFIG_LIBC_STDBIT_GENERIC**: Enable to use the generic C23 implementation
834+
on any architecture (no arch-specific header required). The same redirecting
835+
header is copied to ``include/stdbit.h`` and the in-header generic fallback
836+
is used.
837+
838+
Use either option when your toolchain does not provide ``stdbit.h`` and you
839+
need C23 bit utilities.
840+
822841
# CONFIGURING NUTTX
823842

824843
## Instantiating "Canned" Configurations

0 commit comments

Comments
 (0)