diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-10-29 21:59:03 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-10-29 21:59:03 +0100 |
commit | 5dbf53a1c512f9163744874e3d502e9f9e2808da (patch) | |
tree | a3e1b78c447dd530459fe58eb6c763badb5fa4f1 /include/unicode/string.h | |
parent | 3f7c3d8baa64fecbfb1a30db853731897035fd0b (diff) |
Make ucswdth() take a current width
Diffstat (limited to 'include/unicode/string.h')
-rw-r--r-- | include/unicode/string.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/unicode/string.h b/include/unicode/string.h index 077a45a..4f3760b 100644 --- a/include/unicode/string.h +++ b/include/unicode/string.h @@ -30,7 +30,7 @@ typedef enum { /* clang-format on */ -[[nodiscard]] size_t u8wdth(u8view_t, int); +[[nodiscard]] ptrdiff_t u8wdth(u8view_t, ptrdiff_t, int); [[nodiscard]] size_t u8gcnt(u8view_t); [[nodiscard]] size_t u8wcnt(u8view_t); [[nodiscard]] size_t u8wcnt_human(u8view_t); @@ -44,7 +44,8 @@ size_t u8wnext_human(u8view_t *, u8view_t *); [[nodiscard]] char8_t *u8norm(size_t *, u8view_t, allocator_t, normform_t); /* Encoding-generic macros */ -#define ucswdth(sv, ts) _Generic((sv), u8view_t: u8wdth)((sv), (ts)) +#define ucswdth(sv, curwdth, ts) \ + _Generic((sv), u8view_t: u8wdth)((sv), (curwdth), (ts)) #define ucsgcnt(sv) _Generic((sv), u8view_t: u8gcnt)((sv)) #define ucswcnt(sv) _Generic((sv), u8view_t: u8wcnt)((sv)) #define ucswcnt_human(sv) _Generic((sv), u8view_t: u8wcnt_human)((sv)) |