From b1ae90dd0362b3473a87edae0300e368ea97ab4d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 12 May 2020 21:20:13 -0700 Subject: [PATCH] Global: Add some defs for MSVC highlighting. Just want this file not to be a sea of errors. Before it said ifs etc. were wrong too, because it didn't think things were functions. --- android/jni/app-android.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 649ecade8a..e5b7e8e911 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -14,9 +14,40 @@ #include #include +#ifndef _MSC_VER #include #include #include +#elif !defined(JNIEXPORT) +// Just for better highlighting in MSVC if opening this file. +// Not having types makes it get confused and say everything is wrong. +struct JavaVM; +typedef void *jmethodID; +typedef void *jfieldID; + +typedef uint8_t jboolean; +typedef int8_t jbyte; +typedef int16_t jshort; +typedef int32_t jint; +typedef int64_t jlong; +typedef jint jsize; +typedef float jfloat; +typedef double jdouble; + +class _jobject {}; +class _jclass : public _jobject {}; +typedef _jobject *jobject; +typedef _jclass *jclass; +typedef jobject jstring; +typedef jobject jbyteArray; + +struct JNIEnv {}; + +#define JNIEXPORT +#define JNICALL +// Just a random value to make MSVC highlighting happy. +#define JNI_VERSION_1_6 16 +#endif #include "base/basictypes.h" #include "base/stringutil.h"