]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: update JNI's jobject to uintptr check for newer Android NDKs
authorSteeve Morin <steeve.morin@gmail.com>
Tue, 17 Jul 2018 15:55:01 +0000 (15:55 +0000)
committerIan Lance Taylor <iant@golang.org>
Tue, 17 Jul 2018 16:51:15 +0000 (16:51 +0000)
commit5419e7a09d3ad91aa462621fc86752b092bf2718
tree42b06e61186ca85ce0f68c5154ff2d60bdda96a8
parentbccbf59046b9d1289f3cbf0240d02b8ae550e0ac
cmd/cgo: update JNI's jobject to uintptr check for newer Android NDKs

In Android's NDK16, jobject is now declared as:
    #ifdef __cplusplus
    class _jobject {};
    typedef _jobject*       jobject;
    #else /* not __cplusplus */
    typedef void*           jobject;
    #endif

This makes the jobject to uintptr check fail because it expects the
following definition:
    struct _jobject;
    typedef struct _jobject *jobject;

Update the type check to handle that new type definition in both C and
C++ modes.

Fixes #26213

Change-Id: Ic36d4a5176526998d2d5e4e404f8943961141f7a
GitHub-Last-Rev: 42037c3c584579c2b3281c25372b830e864e7aec
GitHub-Pull-Request: golang/go#26221
Reviewed-on: https://go-review.googlesource.com/122217
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
misc/cgo/test/cgo_test.go
misc/cgo/test/issue26213/jni.h [new file with mode: 0644]
misc/cgo/test/issue26213/test26213.go [new file with mode: 0644]
misc/cgo/test/test26213.go [new file with mode: 0644]
src/cmd/cgo/gcc.go
src/cmd/dist/test.go