From: Bruno Haible Date: Thu, 12 Mar 2026 19:37:13 +0000 (+0100) Subject: stdc_load8: New module. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc3770cc98b839dec509ece03ddfb927093373e5;p=thirdparty%2Fgnulib.git stdc_load8: New module. * lib/stdbit.in.h (_GL_STDC_LOAD8_INLINE): New macro. (stdc_load8_beu{8,16,32,64}, stdc_load8_leu{8,16,32,64}, stdc_load8_bes{8,16,32,64}, stdc_load8_les{8,16,32,64}): New functions. * lib/stdc_load8.c: New file. * m4/stdbit_h.m4 (gl_STDBIT_H_REQUIRE_DEFAULTS): Initialize GNULIB_STDC_LOAD8. * modules/stdbit-h (Makefile.am): Substitute GNULIB_STDC_LOAD8. * modules/stdc_load8: New file. * doc/posix-functions/stdc_load8_beu8.texi: Mention the new module. * doc/posix-functions/stdc_load8_beu16.texi: Likewise. * doc/posix-functions/stdc_load8_beu32.texi: Likewise. * doc/posix-functions/stdc_load8_beu64.texi: Likewise. * doc/posix-functions/stdc_load8_leu8.texi: Likewise. * doc/posix-functions/stdc_load8_leu16.texi: Likewise. * doc/posix-functions/stdc_load8_leu32.texi: Likewise. * doc/posix-functions/stdc_load8_leu64.texi: Likewise. * doc/posix-functions/stdc_load8_bes8.texi: Likewise. * doc/posix-functions/stdc_load8_bes16.texi: Likewise. * doc/posix-functions/stdc_load8_bes32.texi: Likewise. * doc/posix-functions/stdc_load8_bes64.texi: Likewise. * doc/posix-functions/stdc_load8_les8.texi: Likewise. * doc/posix-functions/stdc_load8_les16.texi: Likewise. * doc/posix-functions/stdc_load8_les32.texi: Likewise. * doc/posix-functions/stdc_load8_les64.texi: Likewise. --- diff --git a/ChangeLog b/ChangeLog index 603cf779ca..8bb1cdfdc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2026-03-12 Bruno Haible + + stdc_load8: New module. + * lib/stdbit.in.h (_GL_STDC_LOAD8_INLINE): New macro. + (stdc_load8_beu{8,16,32,64}, stdc_load8_leu{8,16,32,64}, + stdc_load8_bes{8,16,32,64}, stdc_load8_les{8,16,32,64}): New functions. + * lib/stdc_load8.c: New file. + * m4/stdbit_h.m4 (gl_STDBIT_H_REQUIRE_DEFAULTS): Initialize + GNULIB_STDC_LOAD8. + * modules/stdbit-h (Makefile.am): Substitute GNULIB_STDC_LOAD8. + * modules/stdc_load8: New file. + * doc/posix-functions/stdc_load8_beu8.texi: Mention the new module. + * doc/posix-functions/stdc_load8_beu16.texi: Likewise. + * doc/posix-functions/stdc_load8_beu32.texi: Likewise. + * doc/posix-functions/stdc_load8_beu64.texi: Likewise. + * doc/posix-functions/stdc_load8_leu8.texi: Likewise. + * doc/posix-functions/stdc_load8_leu16.texi: Likewise. + * doc/posix-functions/stdc_load8_leu32.texi: Likewise. + * doc/posix-functions/stdc_load8_leu64.texi: Likewise. + * doc/posix-functions/stdc_load8_bes8.texi: Likewise. + * doc/posix-functions/stdc_load8_bes16.texi: Likewise. + * doc/posix-functions/stdc_load8_bes32.texi: Likewise. + * doc/posix-functions/stdc_load8_bes64.texi: Likewise. + * doc/posix-functions/stdc_load8_les8.texi: Likewise. + * doc/posix-functions/stdc_load8_les16.texi: Likewise. + * doc/posix-functions/stdc_load8_les32.texi: Likewise. + * doc/posix-functions/stdc_load8_les64.texi: Likewise. + 2026-03-12 Bruno Haible stdc_load8_aligned: Add tests. diff --git a/doc/posix-functions/stdc_load8_bes16.texi b/doc/posix-functions/stdc_load8_bes16.texi index 8f94a58ac1..9801f59702 100644 --- a/doc/posix-functions/stdc_load8_bes16.texi +++ b/doc/posix-functions/stdc_load8_bes16.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_bes32.texi b/doc/posix-functions/stdc_load8_bes32.texi index 37ee0e72c1..c86c1b307e 100644 --- a/doc/posix-functions/stdc_load8_bes32.texi +++ b/doc/posix-functions/stdc_load8_bes32.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_bes64.texi b/doc/posix-functions/stdc_load8_bes64.texi index a4dd1896c2..716d609864 100644 --- a/doc/posix-functions/stdc_load8_bes64.texi +++ b/doc/posix-functions/stdc_load8_bes64.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_bes8.texi b/doc/posix-functions/stdc_load8_bes8.texi index 24cd7ec159..a84185ea8d 100644 --- a/doc/posix-functions/stdc_load8_bes8.texi +++ b/doc/posix-functions/stdc_load8_bes8.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_beu16.texi b/doc/posix-functions/stdc_load8_beu16.texi index d2f844e3a5..b3eb5e020f 100644 --- a/doc/posix-functions/stdc_load8_beu16.texi +++ b/doc/posix-functions/stdc_load8_beu16.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_beu32.texi b/doc/posix-functions/stdc_load8_beu32.texi index 7c50db4c83..c853598acf 100644 --- a/doc/posix-functions/stdc_load8_beu32.texi +++ b/doc/posix-functions/stdc_load8_beu32.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_beu64.texi b/doc/posix-functions/stdc_load8_beu64.texi index a63a60ec82..980191b98f 100644 --- a/doc/posix-functions/stdc_load8_beu64.texi +++ b/doc/posix-functions/stdc_load8_beu64.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_beu8.texi b/doc/posix-functions/stdc_load8_beu8.texi index 20fc1a1ceb..a7d0a5741b 100644 --- a/doc/posix-functions/stdc_load8_beu8.texi +++ b/doc/posix-functions/stdc_load8_beu8.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_les16.texi b/doc/posix-functions/stdc_load8_les16.texi index 872bfa74fe..3d83af3468 100644 --- a/doc/posix-functions/stdc_load8_les16.texi +++ b/doc/posix-functions/stdc_load8_les16.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_les32.texi b/doc/posix-functions/stdc_load8_les32.texi index 31fa9307ca..4bdd948624 100644 --- a/doc/posix-functions/stdc_load8_les32.texi +++ b/doc/posix-functions/stdc_load8_les32.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_les64.texi b/doc/posix-functions/stdc_load8_les64.texi index 0e8bca6511..186ac64f97 100644 --- a/doc/posix-functions/stdc_load8_les64.texi +++ b/doc/posix-functions/stdc_load8_les64.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_les8.texi b/doc/posix-functions/stdc_load8_les8.texi index 461395ea73..c8cb49bd75 100644 --- a/doc/posix-functions/stdc_load8_les8.texi +++ b/doc/posix-functions/stdc_load8_les8.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_leu16.texi b/doc/posix-functions/stdc_load8_leu16.texi index 563da34f3c..7efaf5108b 100644 --- a/doc/posix-functions/stdc_load8_leu16.texi +++ b/doc/posix-functions/stdc_load8_leu16.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_leu32.texi b/doc/posix-functions/stdc_load8_leu32.texi index 9f273bd41b..58d0759891 100644 --- a/doc/posix-functions/stdc_load8_leu32.texi +++ b/doc/posix-functions/stdc_load8_leu32.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_leu64.texi b/doc/posix-functions/stdc_load8_leu64.texi index b91a2dc20c..0b5ce4efd6 100644 --- a/doc/posix-functions/stdc_load8_leu64.texi +++ b/doc/posix-functions/stdc_load8_leu64.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/doc/posix-functions/stdc_load8_leu8.texi b/doc/posix-functions/stdc_load8_leu8.texi index b2c62b5159..1f8b41b339 100644 --- a/doc/posix-functions/stdc_load8_leu8.texi +++ b/doc/posix-functions/stdc_load8_leu8.texi @@ -7,15 +7,16 @@ ISO C2y (draft @url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf}) section 7.18.21. -Gnulib module: --- +Gnulib module: stdc_load8 +@mindex stdc_load8 Portability problems fixed by Gnulib: @itemize +@item +This function is missing on many platforms: +glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize Portability problems not fixed by Gnulib: @itemize -@item -This function is missing on many platforms: -glibc 2.43, macOS 26, FreeBSD 15.0, NetBSD 10.0, OpenBSD 7.8, AIX 7.3.1, HP-UX 11.31, Solaris 11.4, Cygwin 3.5.3, mingw, MSVC 17, Android 15. @end itemize diff --git a/lib/stdbit.in.h b/lib/stdbit.in.h index a26ce77292..e171606e25 100644 --- a/lib/stdbit.in.h +++ b/lib/stdbit.in.h @@ -37,12 +37,16 @@ #error "Please include config.h first." #endif -#if @GNULIB_STDC_LOAD8_ALIGNED@ +#if @GNULIB_STDC_LOAD8_ALIGNED@ || @GNULIB_STDC_LOAD8@ /* Get int_least8_t, int_least16_t, int_least32_t, int_least64_t, uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t. */ # include +#endif + +#if @GNULIB_STDC_LOAD8_ALIGNED@ + /* Get bswap_16, bswap_32, bswap_64. */ # include @@ -98,6 +102,9 @@ _GL_INLINE_HEADER_BEGIN #ifndef _GL_STDC_LOAD8_ALIGNED_INLINE # define _GL_STDC_LOAD8_ALIGNED_INLINE _GL_INLINE #endif +#ifndef _GL_STDC_LOAD8_INLINE +# define _GL_STDC_LOAD8_INLINE _GL_INLINE +#endif /* An expression, preferably with the type of A, that has the value of B. */ #if ((defined __GNUC__ && 2 <= __GNUC__) \ @@ -1262,6 +1269,126 @@ stdc_load8_aligned_les64 (const unsigned char ptr[8]) #endif +#if @GNULIB_STDC_LOAD8@ + +_GL_STDC_LOAD8_INLINE uint_least8_t +stdc_load8_beu8 (const unsigned char ptr[1]) +{ + return ptr[0]; +} + +_GL_STDC_LOAD8_INLINE uint_least16_t +stdc_load8_beu16 (const unsigned char ptr[2]) +{ + return ((uint_fast16_t) ptr[0] << 8) | (uint_fast16_t) ptr[1]; +} + +_GL_STDC_LOAD8_INLINE uint_least32_t +stdc_load8_beu32 (const unsigned char ptr[4]) +{ + return ((uint_fast32_t) ptr[0] << 24) | ((uint_fast32_t) ptr[1] << 16) + | ((uint_fast32_t) ptr[2] << 8) | (uint_fast32_t) ptr[3]; +} + +_GL_STDC_LOAD8_INLINE uint_least64_t +stdc_load8_beu64 (const unsigned char ptr[8]) +{ + return ((uint_fast64_t) ptr[0] << 56) | ((uint_fast64_t) ptr[1] << 48) + | ((uint_fast64_t) ptr[2] << 40) | ((uint_fast64_t) ptr[3] << 32) + | ((uint_fast64_t) ptr[4] << 24) | ((uint_fast64_t) ptr[5] << 16) + | ((uint_fast64_t) ptr[6] << 8) | (uint_fast64_t) ptr[7]; +} + +_GL_STDC_LOAD8_INLINE uint_least8_t +stdc_load8_leu8 (const unsigned char ptr[1]) +{ + return ptr[0]; +} + +_GL_STDC_LOAD8_INLINE uint_least16_t +stdc_load8_leu16 (const unsigned char ptr[2]) +{ + return (uint_fast16_t) ptr[0] | ((uint_fast16_t) ptr[1] << 8); +} + +_GL_STDC_LOAD8_INLINE uint_least32_t +stdc_load8_leu32 (const unsigned char ptr[4]) +{ + return (uint_fast32_t) ptr[0] | ((uint_fast32_t) ptr[1] << 8) + | ((uint_fast32_t) ptr[2] << 16) | ((uint_fast32_t) ptr[3] << 24); +} + +_GL_STDC_LOAD8_INLINE uint_least64_t +stdc_load8_leu64 (const unsigned char ptr[8]) +{ + return (uint_fast64_t) ptr[0] | ((uint_fast64_t) ptr[1] << 8) + | ((uint_fast64_t) ptr[2] << 16) | ((uint_fast64_t) ptr[3] << 24) + | ((uint_fast64_t) ptr[4] << 32) | ((uint_fast64_t) ptr[5] << 40) + | ((uint_fast64_t) ptr[6] << 48) | ((uint_fast64_t) ptr[7] << 56); +} + +_GL_STDC_LOAD8_INLINE int_least8_t +stdc_load8_bes8 (const unsigned char ptr[1]) +{ + return *(signed char *)ptr; +} + +_GL_STDC_LOAD8_INLINE int_least16_t +stdc_load8_bes16 (const unsigned char ptr[2]) +{ + return (int16_t) (((uint_fast16_t) ptr[0] << 8) | (uint_fast16_t) ptr[1]); +} + +_GL_STDC_LOAD8_INLINE int_least32_t +stdc_load8_bes32 (const unsigned char ptr[4]) +{ + return (int32_t) + (((uint_fast32_t) ptr[0] << 24) | ((uint_fast32_t) ptr[1] << 16) + | ((uint_fast32_t) ptr[2] << 8) | (uint_fast32_t) ptr[3]); +} + +_GL_STDC_LOAD8_INLINE int_least64_t +stdc_load8_bes64 (const unsigned char ptr[8]) +{ + return (int64_t) + (((uint_fast64_t) ptr[0] << 56) | ((uint_fast64_t) ptr[1] << 48) + | ((uint_fast64_t) ptr[2] << 40) | ((uint_fast64_t) ptr[3] << 32) + | ((uint_fast64_t) ptr[4] << 24) | ((uint_fast64_t) ptr[5] << 16) + | ((uint_fast64_t) ptr[6] << 8) | (uint_fast64_t) ptr[7]); +} + +_GL_STDC_LOAD8_INLINE int_least8_t +stdc_load8_les8 (const unsigned char ptr[1]) +{ + return *(signed char *)ptr; +} + +_GL_STDC_LOAD8_INLINE int_least16_t +stdc_load8_les16 (const unsigned char ptr[2]) +{ + return (int16_t) ((uint_fast16_t) ptr[0] | ((uint_fast16_t) ptr[1] << 8)); +} + +_GL_STDC_LOAD8_INLINE int_least32_t +stdc_load8_les32 (const unsigned char ptr[4]) +{ + return (int32_t) + ((uint_fast32_t) ptr[0] | ((uint_fast32_t) ptr[1] << 8) + | ((uint_fast32_t) ptr[2] << 16) | ((uint_fast32_t) ptr[3] << 24)); +} + +_GL_STDC_LOAD8_INLINE int_least64_t +stdc_load8_les64 (const unsigned char ptr[8]) +{ + return (int64_t) + ((uint_fast64_t) ptr[0] | ((uint_fast64_t) ptr[1] << 8) + | ((uint_fast64_t) ptr[2] << 16) | ((uint_fast64_t) ptr[3] << 24) + | ((uint_fast64_t) ptr[4] << 32) | ((uint_fast64_t) ptr[5] << 40) + | ((uint_fast64_t) ptr[6] << 48) | ((uint_fast64_t) ptr[7] << 56)); +} + +#endif + #ifdef __cplusplus } diff --git a/lib/stdc_load8.c b/lib/stdc_load8.c new file mode 100644 index 0000000000..af3d4118fc --- /dev/null +++ b/lib/stdc_load8.c @@ -0,0 +1,19 @@ +/* stdc_load8_* (unaligned) functions. + Copyright (C) 2026 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#define _GL_STDC_LOAD8_INLINE _GL_EXTERN_INLINE +#include +#include diff --git a/m4/stdbit_h.m4 b/m4/stdbit_h.m4 index 31f82c375c..7872902b6c 100644 --- a/m4/stdbit_h.m4 +++ b/m4/stdbit_h.m4 @@ -1,5 +1,5 @@ # stdbit_h.m4 -# serial 6 +# serial 7 dnl Copyright 2024-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -67,6 +67,7 @@ AC_DEFUN([gl_STDBIT_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDC_BIT_FLOOR]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDC_BIT_CEIL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDC_LOAD8_ALIGNED]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDC_LOAD8]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_STDBIT_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_STDBIT_H_DEFAULTS]) diff --git a/modules/stdbit-h b/modules/stdbit-h index 69e4a3ea19..2e4ca2ebcc 100644 --- a/modules/stdbit-h +++ b/modules/stdbit-h @@ -47,6 +47,7 @@ stdbit.h: stdbit.in.h $(top_builddir)/config.status -e 's/@''GNULIB_STDC_BIT_FLOOR''@/$(GNULIB_STDC_BIT_FLOOR)/g' \ -e 's/@''GNULIB_STDC_BIT_CEIL''@/$(GNULIB_STDC_BIT_CEIL)/g' \ -e 's/@''GNULIB_STDC_LOAD8_ALIGNED''@/$(GNULIB_STDC_LOAD8_ALIGNED)/g' \ + -e 's/@''GNULIB_STDC_LOAD8''@/$(GNULIB_STDC_LOAD8)/g' \ $(srcdir)/stdbit.in.h > $@-t $(AM_V_at)mv $@-t $@ lib_SOURCES += stdbit.c diff --git a/modules/stdc_load8 b/modules/stdc_load8 new file mode 100644 index 0000000000..db82fc11d4 --- /dev/null +++ b/modules/stdc_load8 @@ -0,0 +1,27 @@ +Description: +stdc_load8_* (unaligned) functions: Endian-aware loading of a few bytes. + +Files: +lib/stdc_load8.c + +Depends-on: +stdbit-h +stdint-h + +configure.ac: +AC_REQUIRE([gl_STDBIT_H]) +gl_STDBIT_MODULE_INDICATOR([stdc_load8]) + +Makefile.am: +if GL_GENERATE_STDBIT_H +lib_SOURCES += stdc_load8.c +endif + +Include: + + +License: +LGPLv2+ + +Maintainer: +all