Browse Source

Fixes for android build

JNI-44
Edouard Tisserant 10 years ago
parent
commit
5a87babd20
  1. 3
      android/jni/Android.mk
  2. 1
      src/gen_cpp_Message.ysl2
  3. 14
      src/jniutils.cc

3
android/jni/Android.mk

@ -59,6 +59,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libetpan
LOCAL_SRC_FILES := ../build/libetpan-android-1/libs/$(TARGET_ARCH_ABI)/libetpan.a
LOCAL_EXPORT_C_INCLUDES := build/libetpan-android-1/include
LOCAL_EXPORT_LDLIBS := -lz
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
@ -70,7 +71,7 @@ include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := pEpJNIAdapter
LOCAL_SHARED_LIBRARIES := libgpgme
LOCAL_STATIC_LIBRARIES := openssl cyrus-sasl libetpan pEpEngine
LOCAL_STATIC_LIBRARIES := pEpEngine libetpan openssl cyrus-sasl
LOCAL_CPP_FEATURES += exceptions
LOCAL_SRC_FILES := \
../../src/org_pEp_jniadapter_Engine.cc \

1
src/gen_cpp_Message.ysl2

@ -14,6 +14,7 @@ tstylesheet {
#include <exception>
#include <new>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <pEp/«@name».h>

14
src/jniutils.cc

@ -2,9 +2,23 @@
#include <stdexcept>
#include <typeinfo>
#include <time.h>
#include <stdlib.h>
#include <assert.h>
#include <string>
#ifdef ANDROID
#include <time64.h>
time_t timegm(struct tm* const t) {
static const time_t kTimeMax = ~(1L << (sizeof(time_t) * CHAR_BIT - 1));
static const time_t kTimeMin = (1L << (sizeof(time_t) * CHAR_BIT - 1));
time64_t result = timegm64(t);
if (result < kTimeMin || result > kTimeMax)
return -1;
return result;
}
#endif
namespace pEp {
namespace JNIAdapter {
jclass findClass(JNIEnv *env, const char *classname)

Loading…
Cancel
Save