Diego Biurrun <[email protected]> writes: > On Sat, Jul 09, 2011 at 12:35:49PM +0100, Måns Rullgård wrote: >> Diego Biurrun <[email protected]> writes: >> >> > On Sat, Jul 09, 2011 at 11:45:11AM +0100, Mans Rullgard wrote: >> >> --- a/libavcodec/bit_depth_template.c >> >> +++ b/libavcodec/bit_depth_template.c >> >> @@ -85,13 +85,7 @@ >> >> >> >> -#if BIT_DEPTH == 8 >> >> -# define FUNC(a) a ## _8 >> >> -# define FUNCC(a) a ## _8_c >> >> -#elif BIT_DEPTH == 9 >> >> -# define FUNC(a) a ## _9 >> >> -# define FUNCC(a) a ## _9_c >> >> -#elif BIT_DEPTH == 10 >> >> -# define FUNC(a) a ## _10 >> >> -# define FUNCC(a) a ## _10_c >> >> -#endif >> >> +#define FUNC3(a, b, c) a ## _ ## b ## c >> >> +#define FUNC2(a, b, c) FUNC3(a, b, c) >> >> +#define FUNC(a) FUNC2(a, BIT_DEPTH,) >> >> +#define FUNCC(a) FUNC2(a, BIT_DEPTH, _c) >> > >> > I'm puzzled why you need FUNC3 and FUNC2 both here. >> >> It's needed to expand BIT_DEPTH all the way. Otherwise you get >> foo_BIT_DEPTH instead of foo_8. > > I suspect I'm not the only one who will not immediately get this, > so an explanatory comment would not hurt.
People should learn C. -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
