Re: linux/macros.h(new) and linux/list.h(mod) ...

Neil Booth
2001-07-06T17:40:20Z

Alan Cox wrote:-

> #define min(a,b) __magic_minfoo(a,b, __var##__LINE__, __var2##__LINE__)
>
> #define __magic_minfoo(A,B,C,D) \
> { typeof(A) C = (A) .... }

No, that's buggy. You need an extra level of indirection to expand
__LINE__. Arguments to ## are inserted in-place without expansion.

Neil.