Android build fix

This commit is contained in:
Joseph Henry
2016-07-11 19:42:57 -05:00
parent efce6da230
commit 90ae7d7e32
21 changed files with 831 additions and 106 deletions

View File

@@ -47,7 +47,6 @@
#include "OSUtils.hpp"
#include "SDK.h"
void zt_init_rpc(const char * path, const char * nwid);
#include "SDK_Debug.h"
#include "SDK_ServiceSetup.hpp"
@@ -64,6 +63,8 @@ std::string netDir;
extern "C" {
#endif
void zt_init_rpc(const char * path, const char * nwid);
#if defined(__UNITY_3D__)
// .NET Interop-friendly debug mechanism
typedef void (*FuncPtr)( const char * );
@@ -134,7 +135,7 @@ extern "C" {
// JNI naming convention: Java_PACKAGENAME_CLASSNAME_METHODNAME
JNIEXPORT void JNICALL Java_ZeroTier_SDK_startOneService(JNIEnv *env, jobject thisObj, jstring path) {
//char * path;
homeDir = (*env)->GetStringUTFChars(env, path, NULL);
homeDir = env->GetStringUTFChars(path, NULL);
#else
void *startOneService(void *thread_id) {
#endif

View File

@@ -50,7 +50,7 @@ extern std::string homeDir;
/* If you define anything else in this file it that you wish to expose to your Android
Java application you *must* follow that convention and any corresponding Java package/classes
in your Android project must match this as well */
JNIEXPORT void JNICALL Java_ZeroTier_SDK_startOneService(JNIEnv *env, jobject thisObj);
JNIEXPORT void JNICALL Java_ZeroTier_SDK_startOneService(JNIEnv *env, jobject thisObj, jstring path);
#else
void *startOneService(void *thread_id);
void init_service(int key, const char * path);