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:
parent
9a6dc5ac40
commit
5a19113432
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue