From d5b8fb1623bebcf0646aba78cfd8208159e1cc45 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 25 Jun 2016 14:50:03 +0200 Subject: [PATCH] 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 --- bind/java/context_android.c | 1 + bind/java/seq_android.c.support | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bind/java/context_android.c b/bind/java/context_android.c index d98325c..1e3a59c 100644 --- a/bind/java/context_android.c +++ b/bind/java/context_android.c @@ -4,6 +4,7 @@ #include #include "seq.h" +#include "_cgo_export.h" JNIEXPORT void JNICALL Java_go_Seq_setContext(JNIEnv* env, jclass clazz, jobject ctx) { diff --git a/bind/java/seq_android.c.support b/bind/java/seq_android.c.support index b491fa5..2bc1c6a 100644 --- a/bind/java/seq_android.c.support +++ b/bind/java/seq_android.c.support @@ -170,7 +170,7 @@ static nstring utf16_decode(jchar *chars, jsize len) { } ndst += encode_rune(buf + ndst, r); } - struct nstring res = {chars: buf, len: ndst}; + struct nstring res = {.chars = buf, .len = ndst}; return res; }