From 6e08a8fea26f9ade5466add295fceb1d5a77b924 Mon Sep 17 00:00:00 2001 From: Hussein Kasem Date: Wed, 9 Feb 2022 17:25:24 +0100 Subject: [PATCH] JNI-174 Wrap __LP64__ related stuff into ifdef ANDROID to keep JNI-158 and don't break dates on android. On android32 bits time_t struct it is 32 bits and this is causing an overflow after 01/Feb/22 giving negative dates and therefore converting from 09/02/22 to 25/02/21. --- src/cxx/jniutils.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/cxx/jniutils.cc b/src/cxx/jniutils.cc index b8653bf..26d1536 100644 --- a/src/cxx/jniutils.cc +++ b/src/cxx/jniutils.cc @@ -1,16 +1,17 @@ -#include #include "jniutils.hh" #include +#include +#include -#ifndef __LP64__ +#ifdef ANDROID + #ifndef __LP64__ -#include + #include -#define time_t time64_t -#define timegm timegm64 -#define gmtime_r gmtime64_r -#else -#include + #define time_t time64_t + #define timegm timegm64 + #define gmtime_r gmtime64_r + #endif #endif namespace pEp {