SWIG 3.0.0 fails to wrap pjsip 2.2.1 with C# code correctly. Everything, as far as I can see, but the files format.h and event,h in the pjmedia project are converted correctly. format.h and event.h contain two enums, pjmedia_format_id and pjmedia_event_type which both get their enum values set using macros.
As an example the field PJMEDIA_FORMAT_PCMA in pjmedia_format_id is set to "PJMEDIA_FORMAT_PACK('A', 'L', 'A', 'W')" which is preprocessed down to "( 'W'<<24 | 'A'<<16 | 'L'<<8 | 'A' )". The resulting C# code as output by swig using -csharp and -c++ as arguments is "PJMEDIA_FORMAT_PCMA = (((W << 24)|(A << 16))|(L << 8))|A". The correct output should have been something like "PJMEDIA_FORMAT_PCMA = ((((int)'W' << 24)|((int)'A' << 16))|((int)'L' << 8))|(int)A".
I've attached format.h, event.h as well as pjmedia_format_id.cs.
Log in to post a comment.