From 6cfa53e46279d36cec481fbe5c3851a9f567bb05 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Mon, 18 Oct 2004 01:40:39 +0000 Subject: [PATCH] more fixes for feature git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6428 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Swig/naming.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/Swig/naming.c b/Source/Swig/naming.c index 35b6d1db4..32e21bd71 100644 --- a/Source/Swig/naming.c +++ b/Source/Swig/naming.c @@ -573,6 +573,24 @@ Swig_features_get(Hash *features, String *prefix, String *name, SwigType *decl, name = rname; } + /* + very specific hack for functions that return pointers/references, + in the long term, %feature should check the entire declaration, + including the returning type, but for now, these declarations + + char f(); -> decl: f(). + char* f(); -> decl: f().p. + char& f(); -> decl: f().r. ? + + are working again, since we get ride of the extra 'p./r.' + */ + if (SwigType_isfunction(decl)) { + rdecl = Copy(decl); + decl = SwigType_pop(rdecl); + Delete(rdecl); + rdecl = decl; + } + /* Printf(stdout,"feature_get: %s %s %s\n", prefix, name, decl); */