Import unsafe in generated Go code, so that pointers stored as type

uintptr do not get garbage collected.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13153 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Ian Lance Taylor 2012-06-05 20:54:08 +00:00
commit 5a19113432

View file

@ -165,6 +165,9 @@ static _gostring_ _swig_makegostring(const char *p, size_t l) {
%insert(go_header) %{
import _ "runtime/cgo"
import "unsafe"
type _ unsafe.Pointer
%}
@ -173,9 +176,12 @@ import _ "runtime/cgo"
%insert(go_header) %{
import "syscall"
import "unsafe"
type _ syscall.Sockaddr
type _ unsafe.Pointer
%}
#endif