Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(705)

Side by Side Diff: third_party/go/src/golang.org/x/mobile/example/libhellojni/hello.c

Issue 1275153002: Remove third_party/golang.org/x/mobile as it is no longer used with Go 1.5. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Remove golang.org/x/mobile Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build android
6
7 // See main.go for commentary.
8
9 #include <android/log.h>
10 #include <jni.h>
11 #include <limits.h>
12 #include "_cgo_export.h"
13
14 JNIEXPORT void JNICALL
15 Java_demo_Demo_hello(JNIEnv* env, jclass clazz, jstring jname) {
16 // Turn Java's UTF16 string into (almost) UTF8.
17 const char *name = (*env)->GetStringUTFChars(env, jname, 0);
18
19 GoString go_name;
20 go_name.p = (char*)name;
21 go_name.n = (*env)->GetStringUTFLength(env, jname);
22
23 // Call into Go.
24 LogHello(go_name);
25
26 (*env)->ReleaseStringUTFChars(env, jname, name);
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698