mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 1484823 - Fix Android build errors with NDK r18-beta1. r=snorp
Getting a working local build with the system clang might be tricky, while building with NDK r17 clang is broken (bug 1484723). NDK r18-beta1 fixes this, but also made all jvalue* method parameters in jni.h const,so in order to support building with it we need to adjust our relevant function types, too. Differential Revision: https://phabricator.services.mozilla.com/D3832 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e7f78d6d6c
commit
e04236b5f9
@ -1,6 +1,7 @@
|
||||
#ifndef mozilla_jni_Types_h__
|
||||
#define mozilla_jni_Types_h__
|
||||
|
||||
#include <android/ndk-version.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include "mozilla/jni/Refs.h"
|
||||
@ -53,10 +54,16 @@ template<class Cls> struct TypeAdapter<LocalRef<Cls>> {
|
||||
#define MOZ_JNICALL_ABI
|
||||
#endif
|
||||
|
||||
#if __NDK_MAJOR__ >= 18
|
||||
#define JVALUE_PTR const jvalue*
|
||||
#else
|
||||
#define JVALUE_PTR jvalue*
|
||||
#endif
|
||||
|
||||
template<class Cls> constexpr jobject
|
||||
(JNIEnv::*TypeAdapter<LocalRef<Cls>>::Call)(jobject, jmethodID, jvalue*) MOZ_JNICALL_ABI;
|
||||
(JNIEnv::*TypeAdapter<LocalRef<Cls>>::Call)(jobject, jmethodID, JVALUE_PTR) MOZ_JNICALL_ABI;
|
||||
template<class Cls> constexpr jobject
|
||||
(JNIEnv::*TypeAdapter<LocalRef<Cls>>::StaticCall)(jclass, jmethodID, jvalue*) MOZ_JNICALL_ABI;
|
||||
(JNIEnv::*TypeAdapter<LocalRef<Cls>>::StaticCall)(jclass, jmethodID, JVALUE_PTR) MOZ_JNICALL_ABI;
|
||||
template<class Cls> constexpr jobject
|
||||
(JNIEnv::*TypeAdapter<LocalRef<Cls>>::Get)(jobject, jfieldID);
|
||||
template<class Cls> constexpr jobject
|
||||
|
@ -19,9 +19,9 @@ namespace detail {
|
||||
#define DEFINE_PRIMITIVE_TYPE_ADAPTER(NativeType, JNIType, JNIName, ABIName) \
|
||||
\
|
||||
constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::Call) \
|
||||
(jobject, jmethodID, jvalue*) MOZ_JNICALL_ABI; \
|
||||
(jobject, jmethodID, JVALUE_PTR) MOZ_JNICALL_ABI; \
|
||||
constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::StaticCall) \
|
||||
(jclass, jmethodID, jvalue*) MOZ_JNICALL_ABI; \
|
||||
(jclass, jmethodID, JVALUE_PTR) MOZ_JNICALL_ABI; \
|
||||
constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::Get) \
|
||||
(jobject, jfieldID) ABIName; \
|
||||
constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::StaticGet) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user