diff options
Diffstat (limited to 'gl/mbchar.h')
| -rw-r--r-- | gl/mbchar.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gl/mbchar.h b/gl/mbchar.h index d77168e7..20e28e5f 100644 --- a/gl/mbchar.h +++ b/gl/mbchar.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Multibyte character data type. | 1 | /* Multibyte character data type. |
| 2 | Copyright (C) 2001, 2005-2007, 2009-2025 Free Software Foundation, Inc. | 2 | Copyright (C) 2001, 2005-2007, 2009-2026 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is free software: you can redistribute it and/or modify | 4 | This file is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as | 5 | it under the terms of the GNU Lesser General Public License as |
| @@ -217,12 +217,12 @@ typedef struct mbchar mbchar_t; | |||
| 217 | ((mbc1).wc_valid && (mbc2).wc_valid \ | 217 | ((mbc1).wc_valid && (mbc2).wc_valid \ |
| 218 | ? (mbc1).wc == (mbc2).wc \ | 218 | ? (mbc1).wc == (mbc2).wc \ |
| 219 | : (mbc1).bytes == (mbc2).bytes \ | 219 | : (mbc1).bytes == (mbc2).bytes \ |
| 220 | && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) | 220 | && memeq ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)) |
| 221 | #define mb_caseequal(mbc1, mbc2) \ | 221 | #define mb_caseequal(mbc1, mbc2) \ |
| 222 | ((mbc1).wc_valid && (mbc2).wc_valid \ | 222 | ((mbc1).wc_valid && (mbc2).wc_valid \ |
| 223 | ? c32tolower ((mbc1).wc) == c32tolower ((mbc2).wc) \ | 223 | ? c32tolower ((mbc1).wc) == c32tolower ((mbc2).wc) \ |
| 224 | : (mbc1).bytes == (mbc2).bytes \ | 224 | : (mbc1).bytes == (mbc2).bytes \ |
| 225 | && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0) | 225 | && memeq ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)) |
| 226 | 226 | ||
| 227 | /* <ctype.h>, <wctype.h> classification. */ | 227 | /* <ctype.h>, <wctype.h> classification. */ |
| 228 | #define mb_isascii(mbc) \ | 228 | #define mb_isascii(mbc) \ |
| @@ -262,9 +262,14 @@ mb_width_aux (char32_t wc) | |||
| 262 | 262 | ||
| 263 | #if defined GNULIB_MBFILE | 263 | #if defined GNULIB_MBFILE |
| 264 | /* Assignment. */ | 264 | /* Assignment. */ |
| 265 | # define mb_setascii(mbc, sc) \ | 265 | MBCHAR_INLINE void |
| 266 | ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \ | 266 | mb_setascii (mbchar_t *mbc, char sc) |
| 267 | (mbc)->wc = (mbc)->buf[0] = (sc)) | 267 | { |
| 268 | mbc->ptr = mbc->buf; | ||
| 269 | mbc->bytes = 1; | ||
| 270 | mbc->wc_valid = true; | ||
| 271 | mbc->wc = mbc->buf[0] = sc; | ||
| 272 | } | ||
| 268 | #endif | 273 | #endif |
| 269 | 274 | ||
| 270 | /* Copying a character. */ | 275 | /* Copying a character. */ |
