Linus Torvalds writes: (Summary)
That might be the right approach, even if I like how it only used
standard C (although _disgusting_ standard C) without it apart from
the small issue of sizeof(void)
the small issue of sizeof(void)
So something like
So something like
#define __is_constant(a) \
__builtin_types_compatible_p(int *, typeof(1 ? ((void*)((a) * 0l)) : (int*)1 ) )
0l)) : (int*)1 ) )
if I counted the parentheses right..
if I counted the parentheses right..
Linus
Linus
Linus
the small issue of sizeof(void)
So something like
So something like
#define __is_constant(a) \
__builtin_types_compatible_p(int *, typeof(1 ? ((void*)((a) * 0l)) : (int*)1 ) )
0l)) : (int*)1 ) )
if I counted the parentheses right..
if I counted the parentheses right..
Linus
Linus
Linus