I don't see how a macro would work, since that would require knowing the function signature. However swig can as it knows the AST. 
That would simplify interface swig files quite a bit. 



On Mon, Oct 21, 2013 at 1:33 PM, William S Fulton <wsf@fultondesigns.co.uk> wrote:
On 24/09/13 23:25, Timothee Cour wrote:
suppose I have:

----
fun.h
struct A{
int foo1(double);
int foo2(double,int);
};
struct B{/*other stuff*/};
----
fun.cpp
//implements fun.h
----
fun.i
%{
#include "fun.h"
%}

struct A{
search_by_name(foo2);
// should behave as if I entered full signature int foo2(double,int);
};

Question: is there a way to export a swig method by simply specifying its
name instead of full signature, as I did in fun.i ?
SWIG supports the C preprocessor, so you could use a macro.

William