* 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 <bruno@clisp.org>
+
+ 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 <bruno@clisp.org>
stdc_load8_aligned: Add tests.
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
#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 <stdint.h>
+#endif
+
+#if @GNULIB_STDC_LOAD8_ALIGNED@
+
/* Get bswap_16, bswap_32, bswap_64. */
# include <byteswap.h>
#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__) \
#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
}
--- /dev/null
+/* 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 <https://www.gnu.org/licenses/>. */
+
+#define _GL_STDC_LOAD8_INLINE _GL_EXTERN_INLINE
+#include <config.h>
+#include <stdbit.h>
# 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,
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])
-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
--- /dev/null
+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:
+<stdbit.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all