Date: Sun, 29 Jul 2012 22:47:21 +0200 From: Luigi Rizzo <rizzo@iet.unipi.it> To: Arnaud Lacombe <lacombar@gmail.com> Cc: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, David Chisnall <theraven@freebsd.org>, current@freebsd.org Subject: Re: RFC: libkern version of inet_ntoa_r Message-ID: <20120729204721.GA87481@onelab2.iet.unipi.it> In-Reply-To: <CACqU3MVNCOdde7atRVT7xaYH1qHjm=4uS0Eih8EgG3=DDaOGCw@mail.gmail.com> References: <20120725155211.GA33971@onelab2.iet.unipi.it> <alpine.BSF.2.00.1207282213171.4474@ai.fobar.qr> <20120729095833.GB80946@onelab2.iet.unipi.it> <CBCC6E24-8D03-422E-B571-1B62FB7667E6@FreeBSD.org> <20120729191958.GB85015@onelab2.iet.unipi.it> <CACqU3MVNCOdde7atRVT7xaYH1qHjm=4uS0Eih8EgG3=DDaOGCw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120729204721.GA87481>