Re: RFC: libkern version of inet_ntoa_r

看板FB_current作者時間13年前 (2012/07/30 04:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串13/17 (看更多)
Hi, On Sun, Jul 29, 2012 at 3:19 PM, Luigi Rizzo <rizzo@iet.unipi.it> wrote: > Remapping f(a) into f(a, b) requires both a macro > and a wrapping function, something like this > > T __f(T1 a, T2 b) { return f(a, b); } > #define f(a) __f(a, b) > This can be done way more easily: void fn(int a, int b) { printf("%d %d\n", a, b); } #define fn(x) ({ fn(x, 42); }) int main(int argc, char **argv) { fn(0); return 0; } works just fine. > but i am not so interested in participating to the IOCCC :) > maybe you should ;-) - Arnaud ps: this construct is used all over the Linux kernel compatibility libraries. _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1G5PP-3H (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1G5PP-3H (FB_current)