From 4a21c5b342b2867a54c3b23e11017d4124c69468 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 10 Mar 2024 14:31:50 +0200 Subject: Add __u8view.h --- include/__u8view.h | 13 +++++++++++++ include/bob.h | 10 +--------- include/mbstring.h | 10 +--------- 3 files changed, 15 insertions(+), 18 deletions(-) create mode 100644 include/__u8view.h (limited to 'include') 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 + +#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) -- cgit v1.2.3