+2026-03-15 Collin Funk <collin.funk1@gmail.com>
+
+ stdc_rotate_left: New module.
+ * lib/stdbit.in.h (_GL_STDC_ROTATE_LEFT_INLINE, _gl_stdc_rotate_left)
+ (stdc_rotate_left): New macros.
+ (stdc_rotate_left_uc, stdc_rotate_left_us, stdc_rotate_left_ui)
+ (stdc_rotate_left_ul, stdc_rotate_left_ull): New functions.
+ * lib/stdc_rotate_left.c: New file.
+ * m4/stdbit_h.m4 (gl_STDBIT_H_REQUIRE_DEFAULTS): Initialize
+ GNULIB_STDC_ROTATE_LEFT.
+ * modules/stdbit-h (Makefile.am): Substitute GNULIB_STDC_ROTATE_LEFT.
+ * modules/stdc_rotate_left: New file.
+ * doc/posix-functions/stdc_rotate_left.texi: Mention the new module.
+
2026-03-15 Bruno Haible <bruno@clisp.org>
posix_spawn-internal: Move private Gnulib functions to _gl_* namespace.
@url{https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3783.pdf})
section 7.18.17.
-Gnulib module: ---
+Gnulib module: stdc_rotate_left
Portability problems fixed by Gnulib:
@itemize
#ifndef _GL_STDC_BIT_CEIL_INLINE
# define _GL_STDC_BIT_CEIL_INLINE _GL_INLINE
#endif
+#ifndef _GL_STDC_ROTATE_LEFT_INLINE
+# define _GL_STDC_ROTATE_LEFT_INLINE _GL_INLINE
+#endif
#ifndef _GL_STDC_MEMREVERSE8_INLINE
# define _GL_STDC_MEMREVERSE8_INLINE _GL_INLINE
#endif
#endif /* @HAVE_STDBIT_H@ */
+/* ISO C2y § 7.18.17 Rotate Left */
+
+#if @GNULIB_STDC_ROTATE_LEFT@
+
+# ifdef __has_builtin
+# if __has_builtin (__builtin_stdc_rotate_left)
+# define _gl_stdc_rotate_left __builtin_stdc_rotate_left
+# define stdc_rotate_left __builtin_stdc_rotate_left
+# endif
+# endif
+
+# ifndef _gl_stdc_rotate_left
+# define _gl_stdc_rotate_left(v, c) \
+ (((v) << ((c) & (sizeof (v) * 8 - 1))) \
+ | ((v) >> (-(c) & (sizeof (v) * 8 - 1))))
+# endif
+
+_GL_STDC_ROTATE_LEFT_INLINE unsigned char
+stdc_rotate_left_uc (unsigned char v, unsigned int c)
+{
+ return _gl_stdc_rotate_left (v, c);
+}
+
+_GL_STDC_ROTATE_LEFT_INLINE unsigned short int
+stdc_rotate_left_us (unsigned short int v, unsigned int c)
+{
+ return _gl_stdc_rotate_left (v, c);
+}
+
+_GL_STDC_ROTATE_LEFT_INLINE unsigned int
+stdc_rotate_left_ui (unsigned int v, unsigned int c)
+{
+ return _gl_stdc_rotate_left (v, c);
+}
+
+_GL_STDC_ROTATE_LEFT_INLINE unsigned long int
+stdc_rotate_left_ul (unsigned long int v, unsigned int c)
+{
+ return _gl_stdc_rotate_left (v, c);
+}
+
+_GL_STDC_ROTATE_LEFT_INLINE unsigned long long int
+stdc_rotate_left_ull (unsigned long long int v, unsigned int c)
+{
+ return _gl_stdc_rotate_left (v, c);
+}
+
+# ifndef stdc_rotate_left
+# define stdc_rotate_left(v, c) \
+ (_GL_STDBIT_TYPEOF_CAST \
+ (v, \
+ (sizeof (v) == 1 ? stdc_rotate_left_uc (v, c) \
+ : sizeof (v) == sizeof (unsigned short int) ? stdc_rotate_left_us (v, c) \
+ : sizeof (v) == sizeof 0u ? stdc_rotate_left_ui (v, c) \
+ : sizeof (v) == sizeof 0ul ? stdc_rotate_left_ul (v, c) \
+ : stdc_rotate_left_ull (v, c))))
+# endif
+
+#endif
/* ISO C2y § 7.18.19 8-bit Memory Reversal */
--- /dev/null
+/* stdc_rotate_left_* 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_ROTATE_LEFT_INLINE _GL_EXTERN_INLINE
+#include <config.h>
+#include <stdbit.h>
# stdbit_h.m4
-# serial 11
+# serial 12
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_WIDTH])
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_ROTATE_LEFT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDC_MEMREVERSE8])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDC_MEMREVERSE8U])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDC_LOAD8_ALIGNED])
-e 's/@''GNULIB_STDC_BIT_WIDTH''@/$(GNULIB_STDC_BIT_WIDTH)/g' \
-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_ROTATE_LEFT''@/$(GNULIB_STDC_ROTATE_LEFT)/g' \
-e 's/@''GNULIB_STDC_MEMREVERSE8''@/$(GNULIB_STDC_MEMREVERSE8)/g' \
-e 's/@''GNULIB_STDC_MEMREVERSE8U''@/$(GNULIB_STDC_MEMREVERSE8U)/g' \
-e 's/@''GNULIB_STDC_LOAD8_ALIGNED''@/$(GNULIB_STDC_LOAD8_ALIGNED)/g' \
--- /dev/null
+Description:
+stdc_rotate_left macro, stdc_rotate_left_* functions:
+Perform a left circular shift.
+
+Files:
+lib/stdc_rotate_left.c
+
+Depends-on:
+stdbit-h
+
+configure.ac:
+AC_REQUIRE([gl_STDBIT_H])
+gl_STDBIT_MODULE_INDICATOR([stdc_rotate_left])
+
+Makefile.am:
+if GL_GENERATE_STDBIT_H
+lib_SOURCES += stdc_rotate_left.c
+endif
+
+Include:
+<stdbit.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+all