Browse Source

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.
pull/17/head
Hussein Kasem 3 years ago
parent
commit
6e08a8fea2
No known key found for this signature in database GPG Key ID: 9E61B9BC790E6B02
  1. 7
      src/cxx/jniutils.cc

7
src/cxx/jniutils.cc

@ -1,7 +1,9 @@
#include <cassert>
#include "jniutils.hh" #include "jniutils.hh"
#include <pEp/pEpLog.hh> #include <pEp/pEpLog.hh>
#include <cassert>
#include <cstring>
#ifdef ANDROID
#ifndef __LP64__ #ifndef __LP64__
#include <time64.h> #include <time64.h>
@ -9,8 +11,7 @@
#define time_t time64_t #define time_t time64_t
#define timegm timegm64 #define timegm timegm64
#define gmtime_r gmtime64_r #define gmtime_r gmtime64_r
#else #endif
#include <string.h>
#endif #endif
namespace pEp { namespace pEp {

Loading…
Cancel
Save