Add Ruby support for item indexing in Lib/carrays.i.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4475 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1b71d0bbd1
commit
ea6bfb1867
1 changed files with 2 additions and 9 deletions
|
|
@ -63,7 +63,7 @@ void NAME##_setitem(TYPE *ary, int index, TYPE value);
|
|||
* interface:
|
||||
*
|
||||
* struct NAME {
|
||||
* NAME(int nelements, TYPE value = 0);
|
||||
* NAME(int nelements);
|
||||
* ~NAME();
|
||||
* TYPE getitem(int index);
|
||||
* void setitem(int index, TYPE value);
|
||||
|
|
@ -80,7 +80,7 @@ typedef TYPE NAME;
|
|||
typedef struct NAME {
|
||||
/* Put language specific enhancements here */
|
||||
|
||||
#if SWIGPYTHON
|
||||
#if defined(SWIGPYTHON) || defined(SWIGRUBY)
|
||||
%rename(__getitem__) getitem;
|
||||
%rename(__setitem__) setitem;
|
||||
#endif
|
||||
|
|
@ -122,11 +122,4 @@ static NAME *frompointer(TYPE *t) {
|
|||
%types(NAME = TYPE);
|
||||
|
||||
%enddef
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue