From ca620251b1233d9147e4820ed38871a8c23a8dc2 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 16 Apr 2024 10:37:49 +0200 Subject: Don’t dunder attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/unicode/prop.h | 2 +- include/unicode/string.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include/unicode') diff --git a/include/unicode/prop.h b/include/unicode/prop.h index 485a0cb..e3e0d5e 100644 --- a/include/unicode/prop.h +++ b/include/unicode/prop.h @@ -482,7 +482,7 @@ enum uprop_ea { EA_W, /* Narrow */ }; -enum [[clang::__flag_enum__]] uprop_gc : uint_least32_t { +enum [[clang::flag_enum]] uprop_gc : uint_least32_t { GC_CN = UINT32_C(1) << 0, /* Not Assigned */ GC_CC = UINT32_C(1) << 1, /* Control */ GC_CF = UINT32_C(1) << 2, /* Format */ diff --git a/include/unicode/string.h b/include/unicode/string.h index 96fef13..81c2aff 100644 --- a/include/unicode/string.h +++ b/include/unicode/string.h @@ -8,7 +8,7 @@ /* clang-format off */ -enum [[clang::__flag_enum__]] caseflags { +enum [[clang::flag_enum]] caseflags { CF_LANG_AZ = 1 << 0, /* Azeri; alias for CF_LANG_TR */ CF_LANG_TR = 1 << 0, /* Turkish; alias for CF_LANG_AZ */ CF_LANG_LT = 1 << 1, /* Lithuanian */ @@ -17,16 +17,16 @@ enum [[clang::__flag_enum__]] caseflags { /* clang-format on */ -[[__nodiscard__]] size_t u8glen(const char8_t *, size_t); +[[nodiscard]] size_t u8glen(const char8_t *, size_t); size_t u8gnext(struct u8view *, const char8_t **, size_t *); -#define _mlib_warn_trunc __nodiscard__("don’t forget to check for truncation") - -[[_mlib_warn_trunc]] size_t u8casefold(char8_t *restrict, size_t, - const char8_t *, size_t, enum caseflags); -[[_mlib_warn_trunc]] size_t u8lower(char8_t *restrict, size_t, const char8_t *, - size_t, enum caseflags); -[[_mlib_warn_trunc]] size_t u8upper(char8_t *restrict, size_t, const char8_t *, - size_t, enum caseflags); +#define mlib_warn_trunc nodiscard("don’t forget to check for truncation") +[[mlib_warn_trunc]] size_t u8casefold(char8_t *restrict, size_t, + const char8_t *, size_t, enum caseflags); +[[mlib_warn_trunc]] size_t u8lower(char8_t *restrict, size_t, const char8_t *, + size_t, enum caseflags); +[[mlib_warn_trunc]] size_t u8upper(char8_t *restrict, size_t, const char8_t *, + size_t, enum caseflags); +#undef mlib_warn_trunc #endif /* !MLIB_UNICODE_STRING_H */ -- cgit v1.2.3