aboutsummaryrefslogtreecommitdiff
path: root/include/mbstring.h
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-03-07 14:06:39 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-03-07 14:06:39 +0100
commitd2f62c83d6e3e60ebcb4810ecfe2e0429fef6c03 (patch)
tree1c2552166326200360d04815c3f6c8b090c6f337 /include/mbstring.h
parent39ff31be4c955d1fb72b2ac5a0e05531f2377c6c (diff)
Prefer macros
Diffstat (limited to 'include/mbstring.h')
-rw-r--r--include/mbstring.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/mbstring.h b/include/mbstring.h
index 9545f1a..15250ff 100644
--- a/include/mbstring.h
+++ b/include/mbstring.h
@@ -24,10 +24,12 @@ struct u8view {
#define U8_BYTE_C(x) (((x) & 0xC0) == 0x80)
/* clang-format on */
-static const rune U8_1B_MAX = 0x00007FL;
-static const rune U8_2B_MAX = 0x0007FFL;
-static const rune U8_3B_MAX = 0x00FFFFL;
-static const rune U8_4B_MAX = 0x10FFFFL;
+#define U8_1B_MAX RUNE_C(0x00007FL)
+#define U8_2B_MAX RUNE_C(0x0007FFL)
+#define U8_3B_MAX RUNE_C(0x00FFFFL)
+#define U8_4B_MAX RUNE_C(0x10FFFFL)
+
+#define U8_LEN_MAX 4
#define PRIsU8 ".*s"
#define U8_PRI_ARGS(sv) ((int)(sv).len), ((sv).p)
@@ -50,6 +52,4 @@ size_t u8spn(const char8_t *, size_t, const rune *, size_t);
# define u8rchr(s, ch, n) __MLIB_Q_PTR(char8_t, u8rchr, (s), (s), (ch), (n))
#endif
-static const int U8_LEN_MAX = 4;
-
#endif /* !MLIB_MBSTRING_H */