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.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg

Reply via email to