[ewg] ofa_1_5_kernel 20091104-0200 daily build status

Brian J. Murrell brian at sun.com
Fri Nov 20 07:14:41 PST 2009


On Fri, 2009-11-20 at 10:06 -0500, Brian J. Murrell wrote: 
> 
> Hrm.  Does cpp's "#if[n]def" construct work with C defined functions?

> My test says no:

But something like this will work:

#include <stdio.h>

static inline int my_foo()
{
	fprintf(stderr, "this is my_foo()\n");
}

static inline int foo()
{
	fprintf(stderr, "this is foo()\n");
}

#define foo() my_foo()

main() {

    foo();

}
$ gcc -o /tmp/a{,.c}
$ /tmp/a
this is my_foo()

But it does mean usurping the possible definition of
ipv6_addr_loopback() in the O/S for the one in OFED, for whatever that's
worth.

b.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/ewg/attachments/20091120/cfbb9f8b/attachment.sig>


More information about the ewg mailing list