]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
mbfile: Make mb_setascii an inline function.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 23 Aug 2025 03:18:13 +0000 (20:18 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sat, 23 Aug 2025 03:18:13 +0000 (20:18 -0700)
* lib/mbchar.h (mb_setascii): Define as an extern inline function
instead of a macro.

ChangeLog
lib/mbchar.h

index 62a792c994ea6795f8cb104d1fd952886b9119c6..5f31013c18eefb94ffc4891a779b3def461e5414 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-08-22  Collin Funk  <collin.funk1@gmail.com>
+
+       mbfile: Make mb_setascii an inline function.
+       * lib/mbchar.h (mb_setascii): Define as an extern inline function
+       instead of a macro.
+
 2024-08-19  Bruno Haible  <bruno@clisp.org>
 
        doc: Update for glibc 2.42.
index d77168e7171bcb8f4a1eb4a26d89ef4b5653ccb0..85422cd527fe3b8de5112e0caaa65d4837ceeb78 100644 (file)
@@ -262,9 +262,14 @@ mb_width_aux (char32_t wc)
 
 #if defined GNULIB_MBFILE
 /* Assignment.  */
-# define mb_setascii(mbc, sc) \
-   ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \
-    (mbc)->wc = (mbc)->buf[0] = (sc))
+MBCHAR_INLINE void
+mb_setascii (mbchar_t *mbc, char sc)
+{
+  mbc->ptr = mbc->buf;
+  mbc->bytes = 1;
+  mbc->wc_valid = true;
+  mbc->wc = mbc->buf[0] = sc;
+}
 #endif
 
 /* Copying a character.  */