Fix bug #1776651 - bug when the director class name is similar to other symbols being used

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9908 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-08-20 19:48:45 +00:00
commit 2824efe6ba
3 changed files with 41 additions and 4 deletions

View file

@ -73,3 +73,34 @@
unsigned long long callull(int i, int j) { return ull(i, j); }
};
%}
// The similarity of the director class name and other symbol names were causing a problem in the code generation
%feature("director") coreCallbacks;
%inline %{
class corePoint3d {};
struct coreCallbacks_On3dEngineRedrawnData
{
corePoint3d _eye;
corePoint3d _at;
};
struct coreCallbacksOn3dEngineRedrawnData
{
corePoint3d _eye;
corePoint3d _at;
};
class coreCallbacks
{
public:
coreCallbacks(void) {}
virtual ~coreCallbacks(void) {}
virtual void On3dEngineRedrawn(const coreCallbacks_On3dEngineRedrawnData& data){}
virtual void On3dEngineRedrawn2(const coreCallbacksOn3dEngineRedrawnData& data){}
};
%}

View file

@ -1949,7 +1949,7 @@ public:
Printf(function_code, "static ");
Printf(function_code, "%s %s(", return_type, proxy_function_name);
Printv(imcall, imclass_name, ".", intermediary_function_name, "(", NIL);
Printv(imcall, imclass_name, ".$imfuncname(", NIL);
if (!static_flag)
Printf(imcall, "swigCPtr");
@ -2066,7 +2066,8 @@ public:
String *ex_intermediary_function_name = Swig_name_member(proxy_class_name, ex_overloaded_name);
String *ex_imcall = Copy(imcall);
Replaceall(ex_imcall, intermediary_function_name, ex_intermediary_function_name);
Replaceall(ex_imcall, "$imfuncname", ex_intermediary_function_name);
Replaceall(imcall, "$imfuncname", intermediary_function_name);
String *excode = NewString("");
if (!Cmp(return_type, "void"))
@ -2078,6 +2079,8 @@ public:
Printv(imcall, excode, NIL);
Delete(ex_overloaded_name);
Delete(excode);
} else {
Replaceall(imcall, "$imfuncname", intermediary_function_name);
}
Replaceall(tm, "$imcall", imcall);
} else {

View file

@ -1931,7 +1931,7 @@ public:
Printf(function_code, "static ");
Printf(function_code, "%s %s(", return_type, proxy_function_name);
Printv(imcall, imclass_name, ".", intermediary_function_name, "(", NIL);
Printv(imcall, imclass_name, ".$imfuncname(", NIL);
if (!static_flag) {
Printf(imcall, "swigCPtr");
@ -2076,7 +2076,8 @@ public:
String *ex_intermediary_function_name = Swig_name_member(proxy_class_name, ex_overloaded_name);
String *ex_imcall = Copy(imcall);
Replaceall(ex_imcall, intermediary_function_name, ex_intermediary_function_name);
Replaceall(ex_imcall, "$imfuncname", ex_intermediary_function_name);
Replaceall(imcall, "$imfuncname", intermediary_function_name);
String *excode = NewString("");
if (!Cmp(return_type, "void"))
@ -2088,6 +2089,8 @@ public:
Printv(imcall, excode, NIL);
Delete(ex_overloaded_name);
Delete(excode);
} else {
Replaceall(imcall, "$imfuncname", intermediary_function_name);
}
Replaceall(tm, "$jnicall", imcall);