*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
432bd404c6
commit
0af3e7f14f
2 changed files with 5 additions and 8 deletions
|
|
@ -97,6 +97,7 @@ typedef struct {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
||||||
#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF(klass), "new")
|
#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
|
||||||
|
#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ public:
|
||||||
|
|
||||||
void create_command(Node *n, const String_or_char *iname) {
|
void create_command(Node *n, const String_or_char *iname) {
|
||||||
|
|
||||||
String *alloc_func_name = Swig_name_wrapper(iname);
|
String *alloc_func = Swig_name_wrapper(iname);
|
||||||
String *wname = Swig_name_wrapper(iname);
|
String *wname = Swig_name_wrapper(iname);
|
||||||
if (CPlusPlus) {
|
if (CPlusPlus) {
|
||||||
Insert(wname,0,"VALUEFUNC(");
|
Insert(wname,0,"VALUEFUNC(");
|
||||||
|
|
@ -479,11 +479,7 @@ public:
|
||||||
iname, "\", ", wname, ", -1);\n", NIL);
|
iname, "\", ", wname, ", -1);\n", NIL);
|
||||||
break;
|
break;
|
||||||
case CONSTRUCTOR_ALLOCATE:
|
case CONSTRUCTOR_ALLOCATE:
|
||||||
Printf(s, "#ifdef HAVE_RB_DEFINE_ALLOC_FUNC\n");
|
Printv(s, tab4, "rb_define_alloc_func(", klass->vname, ", ", alloc_func, ");\n", NIL);
|
||||||
Printv(s, tab4, "rb_define_alloc_func(", klass->vname, ", ", alloc_func_name, ");\n", NIL);
|
|
||||||
Printf(s, "#else\n");
|
|
||||||
Printv(s, tab4, "rb_define_singleton_method(", klass->vname, ", \"new\", ", wname, ", -1);\n", NIL);
|
|
||||||
Printf(s, "#endif\n");
|
|
||||||
Replaceall(klass->init,"$allocator", s);
|
Replaceall(klass->init,"$allocator", s);
|
||||||
break;
|
break;
|
||||||
case CONSTRUCTOR_INITIALIZE:
|
case CONSTRUCTOR_INITIALIZE:
|
||||||
|
|
@ -514,7 +510,7 @@ public:
|
||||||
Delete(temp);
|
Delete(temp);
|
||||||
Delete(s);
|
Delete(s);
|
||||||
Delete(wname);
|
Delete(wname);
|
||||||
Delete(alloc_func_name);
|
Delete(alloc_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------
|
/* ---------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue