2
0
mirror of synced 2025-02-24 07:18:15 +00:00
mobile/bind/testdata/issue12328.go.golden
Elias Naur 7df33f4a5c mobile/bind: allow bound packages to refer to imported bound packages
Multiple packages are already supported, but only as if each packages
were bound in isolation. This CL lets a bound package refer to other
bound packages in its exported functions, types and fields.

In Java, the JNI class jclass and constructor jmethodID are exported
so other packages can construct proxies of other packages' interfaces.

In ObjC, the class @interface declarations are moved from the package
.m file to its .h file to allow other packages to constructs its
interface proxies.

Add a supporting test package, secondpkg, and add Java and ObjC tests
for the new cross package functionality. Also add simplepkg for
testing corner cases where the generated Go file must not include its
bound package.

While we're here, stop generating Go proxy types for struct types;
only Go interfaces can be implemented in the foreign language.

Change-Id: Icbfa739c893703867d38a9100ed0928fbd7a660d
Reviewed-on: https://go-review.googlesource.com/20575
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-03-12 06:23:01 +00:00

45 lines
937 B
Plaintext

// Package gomobile_bind is an autogenerated binder stub for package issue12328.
// gobind -lang=go issue12328
//
// File is generated by gobind. Do not edit.
package gomobile_bind
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "issue12328.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"issue12328"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyissue12328_T_Err_Set
func proxyissue12328_T_Err_Set(refnum C.int32_t, v C.nstring) {
ref := _seq.FromRefNum(int32(refnum))
_v_str := decodeString(v)
_v := toError(_v_str)
ref.Get().(*issue12328.T).Err = _v
}
//export proxyissue12328_T_Err_Get
func proxyissue12328_T_Err_Get(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*issue12328.T).Err
var _v_str string
if v == nil {
_v_str = ""
} else {
_v_str = v.Error()
}
_v := encodeString(_v_str)
return _v
}