Re: RFC: libkern version of inet_ntoa_r

看板FB_current作者時間13年前 (2012/07/30 04:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串15/17 (看更多)
On Sun, Jul 29, 2012 at 03:38:59PM -0400, Arnaud Lacombe wrote: > 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); }) nice trick, one always learns something on these lists... now i wonder how it works with MSVC (windows being one of the other platforms where i need to build the ipfw+dummynet code...) cheers luigi _______________________________________________ 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): #1G5Pt2X3 (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1G5Pt2X3 (FB_current)