diff --git a/Examples/test-suite/python_kwargs.i b/Examples/test-suite/kwargs_feature.i similarity index 98% rename from Examples/test-suite/python_kwargs.i rename to Examples/test-suite/kwargs_feature.i index 28089bbf1..87153109a 100644 --- a/Examples/test-suite/python_kwargs.i +++ b/Examples/test-suite/kwargs_feature.i @@ -1,4 +1,4 @@ -%module python_kwargs +%module kwargs_feature %nocopyctor; %kwargs; diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 7eb700124..185ca2298 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -41,6 +41,7 @@ CPP_TEST_CASES += \ inout \ inplaceadd \ input \ + kwargs_feature \ li_cstring \ li_cwstring \ li_factory \ @@ -58,7 +59,6 @@ CPP_TEST_CASES += \ primitive_types \ python_abstractbase \ python_append \ - python_kwargs \ python_nondynamic \ python_overload_simple_cast \ python_richcompare \ diff --git a/Examples/test-suite/python/python_kwargs_runme.py b/Examples/test-suite/python/kwargs_feature_runme.py similarity index 96% rename from Examples/test-suite/python/python_kwargs_runme.py rename to Examples/test-suite/python/kwargs_feature_runme.py index fb6e191dd..5539e211d 100644 --- a/Examples/test-suite/python/python_kwargs_runme.py +++ b/Examples/test-suite/python/kwargs_feature_runme.py @@ -1,4 +1,4 @@ -from python_kwargs import * +from kwargs_feature import * class MyFoo(Foo): def __init__(self, a , b = 0): diff --git a/Examples/test-suite/ruby/Makefile.in b/Examples/test-suite/ruby/Makefile.in index 27996616e..e157e72ca 100644 --- a/Examples/test-suite/ruby/Makefile.in +++ b/Examples/test-suite/ruby/Makefile.in @@ -10,6 +10,7 @@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ CPP_TEST_CASES = \ + kwargs_feature \ li_cdata \ li_cstring \ li_factory \ diff --git a/Lib/ruby/rubyuserdir.swg b/Lib/ruby/rubyuserdir.swg index 2f67c9ec6..638433c2d 100644 --- a/Lib/ruby/rubyuserdir.swg +++ b/Lib/ruby/rubyuserdir.swg @@ -8,3 +8,13 @@ #define %nooutput %feature("outputs","0") #define %initstack %feature("initstack", "1") #define %ignorestack %feature("initstack", "0") + +/* ------------------------------------------------------------------------- */ +/* + Enable keywords paramaters +*/ + +#define %kwargs %feature("kwargs") +#define %nokwargs %feature("kwargs", "0") +#define %clearkwargs %feature("kwargs", "") + diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index dfb199b6e..d2ce97592 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -1477,7 +1477,7 @@ public: /* Finish argument marshalling */ Printf(kwargs, " NULL }"); if (allow_kwargs) { - Printv(f->locals, tab4, "char *kwnames[] = ", kwargs, ";\n", NIL); + Printv(f->locals, tab4, "const char *kwnames[] = ", kwargs, ";\n", NIL); } /* Trailing varargs */