diff options
-rw-r--r-- | include/__qmacros.h | 8 | ||||
-rw-r--r-- | include/mbstring.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/__qmacros.h b/include/__qmacros.h index d765864..e121e83 100644 --- a/include/__qmacros.h +++ b/include/__qmacros.h @@ -8,16 +8,16 @@ The macros are taken from the N3020 proposal for C23. */ /* clang-format off */ -#define _RUNE_PTR_IS_CONST(P) \ +#define __MLIB_PTR_IS_CONST(P) \ _Generic(1 ? (P) : (void *)(P), \ const void *: 1, \ default: 0) -#define _RUNE_STATIC_IF(P, T, E) \ +#define __MLIB_STATIC_IF(P, T, E) \ _Generic(&(char[!!(P) + 1]){0}, \ char(*)[2]: T, \ char(*)[1]: E) -#define _RUNE_Q_PTR(T, F, S, ...) \ - _RUNE_STATIC_IF(_RUNE_PTR_IS_CONST((S)), \ +#define __MLIB_Q_PTR(T, F, S, ...) \ + __MLIB_STATIC_IF(__MLIB_PTR_IS_CONST((S)), \ (const T *)(F)(__VA_ARGS__), \ (T *)(F)(__VA_ARGS__)) /* clang-format on */ diff --git a/include/mbstring.h b/include/mbstring.h index ddeb514..cf2d6c5 100644 --- a/include/mbstring.h +++ b/include/mbstring.h @@ -42,10 +42,10 @@ size_t u8cspn(const char8_t *, size_t, const rune *, size_t); size_t u8len(const char8_t *, size_t); size_t u8spn(const char8_t *, size_t, const rune *, size_t); -#if !_RUNE_NO_MACRO_WRAPPER -# define u8chk(s, n) _RUNE_Q_PTR(char8_t, u8chk, (s), (s), (n)) -# define u8chr(s, ch, n) _RUNE_Q_PTR(char8_t, u8chr, (s), (s), (ch), (n)) -# define u8rchr(s, ch, n) _RUNE_Q_PTR(char8_t, u8rchr, (s), (s), (ch), (n)) +#if !__MLIB_NO_MACRO_WRAPPER +# define u8chk(s, n) __MLIB_Q_PTR(char8_t, u8chk, (s), (s), (n)) +# define u8chr(s, ch, n) __MLIB_Q_PTR(char8_t, u8chr, (s), (s), (ch), (n)) +# define u8rchr(s, ch, n) __MLIB_Q_PTR(char8_t, u8rchr, (s), (s), (ch), (n)) #endif static const int U8_LEN_MAX = 4; |