[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] [bug #3031] Implement a new fully pool-basedpbufimpleme
From: |
Thomas Mueller |
Subject: |
Re: [lwip-devel] [bug #3031] Implement a new fully pool-basedpbufimplementation. |
Date: |
Thu, 26 Jul 2007 09:12:10 +0200 |
On Wed, 25 Jul 2007 12:17:09 -0700, Grubb, Jared wrote:
> I haven't compiled it, but doesn't this do it:
>
> #define pbuf_clen(p, len) \
> { \
> struct pbuf *q = (p); \
> (len) = 0; \
> while (q != NULL) { \
> ++(len); \
> q = q->next; \
> }\
> len // no semicolon!
> }
GNU-C allows statements and declarations inside expressions like this:
({ int y = foo(); int z;
if (y > 0) z = y;
else z = - y;
z; })
It is a GNU-C extension and not portable.
--
Thomas Mueller
- [lwip-devel] [bug #3031] Implement a new fully pool-based pbuf implementation., (continued)
- RE: [lwip-devel] [bug #3031] Implement a new fully pool-based pbufimplementation., Goldschmidt Simon, 2007/07/25
- RE: [lwip-devel] [bug #3031] Implement a new fully pool-basedpbufimplementation., Grubb, Jared, 2007/07/25
- RE: [lwip-devel] [bug #3031] Implement a new fullypool-basedpbufimplementation., Goldschmidt Simon, 2007/07/26
- RE: [lwip-devel] [bug #3031] Implement a newfullypool-basedpbufimplementation., Grubb, Jared, 2007/07/26
- Re: [lwip-devel] [bug #3031] Implement a new fullypool-basedpbufimplementation., Jonathan Larmour, 2007/07/31
- Re: [lwip-devel] [bug #3031] Implement a new fully pool-basedpbufimplementation.,
Thomas Mueller <=