ICU-23004 default U_FORCE_INLINE=inline

This commit is contained in:
Markus Scherer 2025-03-24 13:06:39 -07:00
parent 4e8ae459d1
commit 8a08d2b886
3 changed files with 11 additions and 7 deletions

View file

@ -132,13 +132,13 @@
#ifdef U_FORCE_INLINE
// already defined
#elif defined(U_IN_DOXYGEN)
# define U_FORCE_INLINE
# define U_FORCE_INLINE inline
#elif (defined(__clang__) && __clang__) || U_GCC_MAJOR_MINOR != 0
# define U_FORCE_INLINE [[gnu::always_inline]]
#elif defined(U_REAL_MSVC)
# define U_FORCE_INLINE __forceinline
#else
# define U_FORCE_INLINE
# define U_FORCE_INLINE inline
#endif
// Before ICU 65, function-like, multi-statement ICU macros were just defined as

View file

@ -31,13 +31,13 @@ constexpr UChar32 U_SENTINEL = -1;
#ifdef U_FORCE_INLINE
// already defined
#elif defined(U_IN_DOXYGEN)
# define U_FORCE_INLINE
# define U_FORCE_INLINE inline
#elif (defined(__clang__) && __clang__) || U_GCC_MAJOR_MINOR != 0
# define U_FORCE_INLINE [[gnu::always_inline]]
#elif defined(U_REAL_MSVC)
# define U_FORCE_INLINE __forceinline
#else
# define U_FORCE_INLINE
# define U_FORCE_INLINE inline
#endif
// unicode/uversion.h
#define U_HEADER_ONLY_NAMESPACE header

View file

@ -27,6 +27,7 @@ using U_HEADER_ONLY_NAMESPACE::utfStringCodePoints;
#if 0
// Sample code for API docs etc. Compile when changing samples or APIs.
#include <iostream>
using U_HEADER_ONLY_NAMESPACE::unsafeUTFIterator;
using U_HEADER_ONLY_NAMESPACE::unsafeUTFStringCodePoints;
@ -110,15 +111,18 @@ std::u32string cpFromInput(InputStream &in) {
// This is a single-pass input_iterator.
std::istreambuf_iterator bufIter(in);
std::istreambuf_iterator<typename InputStream::char_type> bufLimit;
auto begin = utfIterator<char32_t, UTF_BEHAVIOR_FFFD>(bufIter);
auto iter = utfIterator<char32_t, UTF_BEHAVIOR_FFFD>(bufIter);
auto limit = utfIterator<char32_t, UTF_BEHAVIOR_FFFD>(bufLimit);
std::u32string s32;
for (; bufIter != bufLimit; ++bufIter) {
s32.push_back(*bufIter);
for (; iter != limit; ++iter) {
s32.push_back(iter->codePoint());
}
return s32;
}
std::u32string cpFromStdin() { return cpFromInput(std::cin); }
std::u32string cpFromWideStdin() { return cpFromInput(std::wcin); }
#endif // SAMPLE_CODE
template<typename Unit>