aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-03-10 14:31:50 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-03-10 14:31:50 +0200
commit4a21c5b342b2867a54c3b23e11017d4124c69468 (patch)
tree447c60d6cdf8f58a7b2c5d5366add7d390ab23a4 /include
parent4f5361179ca6129df5dd0ffacad91f252d6871b8 (diff)
Add __u8view.h
Diffstat (limited to 'include')
-rw-r--r--include/__u8view.h13
-rw-r--r--include/bob.h10
-rw-r--r--include/mbstring.h10
3 files changed, 15 insertions, 18 deletions
diff --git a/include/__u8view.h b/include/__u8view.h
new file mode 100644
index 0000000..c6073c7
--- /dev/null
+++ b/include/__u8view.h
@@ -0,0 +1,13 @@
+#ifndef MLIB___U8VIEW_H
+#define MLIB___U8VIEW_H
+
+#include <stddef.h>
+
+#include "__charN_t.h"
+
+struct u8view {
+ const char8_t *p;
+ size_t len;
+};
+
+#endif /* !MLIB___U8VIEW_H */
diff --git a/include/bob.h b/include/bob.h
index e39a769..699aa5e 100644
--- a/include/bob.h
+++ b/include/bob.h
@@ -5,15 +5,7 @@
#include "__charN_t.h"
#include "__rune.h"
-
-#if !__MLIB_HAS_U8VIEW
-# define __MLIB_HAS_U8VIEW 1
-
-struct u8view {
- const char8_t *p;
- size_t len;
-};
-#endif
+#include "__u8view.h"
struct u8str {
char8_t *p;
diff --git a/include/mbstring.h b/include/mbstring.h
index e23a00b..3ac9277 100644
--- a/include/mbstring.h
+++ b/include/mbstring.h
@@ -6,15 +6,7 @@
#include "__charN_t.h"
#include "__qmacros.h"
#include "__rune.h"
-
-#if !__MLIB_HAS_U8VIEW
-# define __MLIB_HAS_U8VIEW 1
-
-struct u8view {
- const char8_t *p;
- size_t len;
-};
-#endif
+#include "__u8view.h"
/* clang-format off */
#define U8_BYTE_1(x) (((x) & 0x80) == 0x00)