Displaying 2 results from an estimated 2 matches for "__utf8_charlen".
2009 Mar 15
2
[LLVMdev] [Bug 3756] __attribute__((always_inline)) and __builtin_constant_p
...it's worth, my
always_inline functions are always functions that allow constant-folding
of its result when parameters are known at compile time, or fallbacks to
a real, non inlined, implementation else. Typical (silly but useful for
my point) use is for example, a function that is:
extern int __utf8_charlen(wchar_t c);
__attribute__((always_inline))
static inline int utf8_charlen(wchar_t c) {
if (__builtin_constant_p(c)) {
if (c < 0 || c >= 0x200000)
return 0;
return 1 + (c >= 0x80) + (c >= 0x800) + (c >= 0x10000);
}
return __utf8_charlen(c);
}
I really...
2009 Mar 16
0
[LLVMdev] [Bug 3756] __attribute__((always_inline)) and __builtin_constant_p
...s_inline functions are always functions that allow constant-folding
> of its result when parameters are known at compile time, or fallbacks to
> a real, non inlined, implementation else. Typical (silly but useful for
> my point) use is for example, a function that is:
>
> extern int __utf8_charlen(wchar_t c);
> __attribute__((always_inline))
> static inline int utf8_charlen(wchar_t c) {
> if (__builtin_constant_p(c)) {
> if (c < 0 || c >= 0x200000)
> return 0;
> return 1 + (c >= 0x80) + (c >= 0x800) + (c >= 0x10000);
> }
>...