15 Jun 2012 12:20
"regression" with typedef struct and %typemap(cscode)
marco gaddoni <marco.gaddoni+swig <at> gmail.com>
2012-06-15 10:20:50 GMT
2012-06-15 10:20:50 GMT
Hello !
i think i have found a regression from 2.0.2 to 2.0.5 (and 2.0.7).
Using SWIG 2.0.5-7, I got a problem extending proxy classes with additional C# code.
In this example:
---------
%module test
%typemap(cscode) MyStruct %{ int field_b; %}
%include <typemaps.i>
typedef struct _myStruct
{
int field_a;
} MyStruct;
----------
invoke swig -csharp -c++ .
The code generated by SWIG for MyStruc.cs, doesn't have the member field_b
But if I compile with SWIG 2.0.2-4 got it.
With SWIG 2.0.5-7, the only way to extending MyStruct with field_b, is to substitute the line:
%typemap(cscode) MyStruct %{ int field_b; %}
with
%typemap(cscode) _myStruct %{ int field_b; %}
we are using some typemap to add to
the opencv IplImage some methods to save and load from disk
and dont want to change the library.
I think this is an unwanted change in behavour.
Ciao,
i think i have found a regression from 2.0.2 to 2.0.5 (and 2.0.7).
Using SWIG 2.0.5-7, I got a problem extending proxy classes with additional C# code.
In this example:
---------
%module test
%typemap(cscode) MyStruct %{ int field_b; %}
%include <typemaps.i>
typedef struct _myStruct
{
int field_a;
} MyStruct;
----------
invoke swig -csharp -c++ .
The code generated by SWIG for MyStruc.cs, doesn't have the member field_b
But if I compile with SWIG 2.0.2-4 got it.
With SWIG 2.0.5-7, the only way to extending MyStruct with field_b, is to substitute the line:
%typemap(cscode) MyStruct %{ int field_b; %}
with
%typemap(cscode) _myStruct %{ int field_b; %}
we are using some typemap to add to
the opencv IplImage some methods to save and load from disk
and dont want to change the library.
I think this is an unwanted change in behavour.
Ciao,
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Swig-user mailing list Swig-user <at> lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/swig-user
RSS Feed