2
0
mirror of synced 2025-02-23 14:58:12 +00:00
mobile/bind/java/context_android.c
Elias Naur d5b8fb1623 mobile/bind/java: fix compiler warnings
Add a missing #include to declare the exported Go function
setContext, and replace old GNU-style struct initializers.

Change-Id: Id1660559236c39505a47368a700c8e0ad834cf6c
Reviewed-on: https://go-review.googlesource.com/24491
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-28 17:54:14 +00:00

17 lines
453 B
C

// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include <jni.h>
#include "seq.h"
#include "_cgo_export.h"
JNIEXPORT void JNICALL
Java_go_Seq_setContext(JNIEnv* env, jclass clazz, jobject ctx) {
JavaVM* vm;
if ((*env)->GetJavaVM(env, &vm) != 0) {
LOG_FATAL("failed to get JavaVM");
}
setContext(vm, (*env)->NewGlobalRef(env, ctx));
}