{"action":"created","issue":{"url":"https://api.github.com/repos/swig/swig/issues/433","labels_url":"https://api.github.com/repos/swig/swig/issues/433/labels{/name}","comments_url":"https://api.github.com/repos/swig/swig/issues/433/comments","events_url":"https://api.github.com/repos/swig/swig/issues/433/events","html_url":"https://github.com/swig/swig/issues/433","id":86776611,"number":433,"title":"Swig 3.0.5 generates broken C# code","user":{"login":"darksylinc","id":3395130,"avatar_url":"https://avatars.githubusercontent.com/u/3395130?v=3","gravatar_id":"","url":"https://api.github.com/users/darksylinc","html_url":"https://github.com/darksylinc","followers_url":"https://api.github.com/users/darksylinc/followers","following_url":"https://api.github.com/users/darksylinc/following{/other_user}","gists_url":"https://api.github.com/users/darksylinc/gists{/gist_id}","starred_url":"https://api.github.com/users/darksylinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darksylinc/subscriptions","organizations_url":"https://api.github.com/users/darksylinc/orgs","repos_url":"https://api.github.com/users/darksylinc/repos","events_url":"https://api.github.com/users/darksylinc/events{/privacy}","received_events_url":"https://api.github.com/users/darksylinc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-10T00:06:05Z","updated_at":"2015-06-10T02:56:17Z","closed_at":null,"body":"Download the RakNet repository:\r\nhttps://github.com/OculusVR/RakNet\r\n\r\nGo to DependentExtensions/Swig and run:\r\nMakeSwig.bat \"../../Source\"\r\n\r\nIt should run Swig and dump it in:\r\nDependentExtensions\\Swig\\SwigOutput\\SwigCSharpOutput\r\n\r\nThis is an example of the generated Packet.cs:\r\nhttp://pastebin.com/JpGNr4S9\r\n\r\nIt uses 'HandleRef' and 'IntPtr' all over the place without full namespace and without declaring \"using System.Runtime.InteropServices;\" either which ends up in build errors.\r\n\r\nMany other C# files share the same problem, making it a royal PITA to add the namespaces by hand."},"comment":{"url":"https://api.github.com/repos/swig/swig/issues/comments/110568989","html_url":"https://github.com/swig/swig/issues/433#issuecomment-110568989","issue_url":"https://api.github.com/repos/swig/swig/issues/433","id":110568989,"user":{"login":"darksylinc","id":3395130,"avatar_url":"https://avatars.githubusercontent.com/u/3395130?v=3","gravatar_id":"","url":"https://api.github.com/users/darksylinc","html_url":"https://github.com/darksylinc","followers_url":"https://api.github.com/users/darksylinc/followers","following_url":"https://api.github.com/users/darksylinc/following{/other_user}","gists_url":"https://api.github.com/users/darksylinc/gists{/gist_id}","starred_url":"https://api.github.com/users/darksylinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darksylinc/subscriptions","organizations_url":"https://api.github.com/users/darksylinc/orgs","repos_url":"https://api.github.com/users/darksylinc/repos","events_url":"https://api.github.com/users/darksylinc/events{/privacy}","received_events_url":"https://api.github.com/users/darksylinc/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T02:56:17Z","updated_at":"2015-06-10T02:56:17Z","body":"Thanks for the (very!) quick response. The code is not really mine. It's RakNet which was originally meant to be used with Swig 2.x\r\nI'm not a Swig expert either.\r\n\r\nI can see they do set custom imtypes in https://github.com/OculusVR/RakNet/blob/master/DependentExtensions/Swig/SwigInterfaceFiles/arrays_csharp.i\r\n\r\nspecifically, I can see they do:\r\n\r\n%typemap(imtype)  CTYPE FIXED[] \"IntPtr\"\r\n\r\nwhich looks very suspicious. Is there a \"right\" way to prefix it? or may be it's just\r\n%typemap(imtype)  CTYPE FIXED[] \"global::System.Runtime.InteropService.IntPtr\" ??"}}