[Go] Remove all generated calls to _swig_makegostring, as it will no

longer as of Go 1.5.  In Go 1.5 or later user calls to
_swig_makegostring will fail at link time.

Instead, use goout and godirectorin typemaps to allocate strings in Go
code.

Change the Go typemaps support to ignore empty strings, so that we can
define empty strings for regular types so that %apply will override
the definitions for string types.

Fix the gccgo code to wrap SwigCgoCallback around all godirectorin
typemaps.

Add a few newlines after typemap code so that the typemaps don't have
to include them.
This commit is contained in:
Ian Lance Taylor 2015-02-05 10:15:37 -08:00
commit 0a021a938e
7 changed files with 261 additions and 50 deletions

View file

@ -795,7 +795,8 @@ gotype is best converted to C/C++ using Go code.
<td>
Go code to convert from gotype to imtype when calling a C/C++
function. SWIG will then internally convert imtype to a C/C++ type
and pass it down. If this is not defined no conversion is done.
and pass it down. If this is not defined, or is the empty string, no
conversion is done.
</td>
</tr>
@ -822,7 +823,8 @@ to the desired type.
<td>goout</td>
<td>
Go code to convert a value returned from a C/C++ function from imtype
to gotype. If this is not defined no conversion is done.
to gotype. If this is not defined, or is the empty string, no
conversion is done.
</td>
</tr>
@ -843,7 +845,7 @@ be done.
Go code to adjust an argument value when returning from a function.
This is called after the real C/C++ function has run. The value will
be in imtype. This is only useful for a pointer type of some sort.
If this is not defined nothing will be done.
If this is not defined, or is the empty string, nothing will be done.
</td>
</tr>
@ -861,7 +863,8 @@ to the desired type.
<td>godirectorin</td>
<td>
Go code to convert a value used to call a director method from imtype
to gotype. If this is not defined no conversion is done.
to gotype. If this is not defined, or is the empty string, no
conversion is done.
</td>
</tr>
@ -869,7 +872,8 @@ to gotype. If this is not defined no conversion is done.
<td>godirectorout</td>
<td>
Go code to convert a value returned from a director method from gotype
to imtype. If this is not defined no conversion is done.
to imtype. If this is not defined, or is the empty string, no
conversion is done.
</td>
</tr>