summaryrefslogtreecommitdiffstats
path: root/base/os_compat_android.cc
diff options
context:
space:
mode:
authorprimiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-29 00:05:57 +0000
committerprimiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-29 00:05:57 +0000
commit3079fabc517737e0b745184dbf72de2e9b2176a3 (patch)
tree6010f9d407e1183cbcd99ace7afc90be4d5a7fd4 /base/os_compat_android.cc
parent65249aaa7cec43e604815cec22dc33a31f1f77f2 (diff)
downloadchromium_src-3079fabc517737e0b745184dbf72de2e9b2176a3.zip
chromium_src-3079fabc517737e0b745184dbf72de2e9b2176a3.tar.gz
chromium_src-3079fabc517737e0b745184dbf72de2e9b2176a3.tar.bz2
[Android]: Don't redefine timegm on arm64.
The latest Android NDK finally provides a timegm implementation. No need to re-define in the compat layer anymore for 64-bit devices. BUG=366054, 354405 Review URL: https://codereview.chromium.org/256103005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266706 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/os_compat_android.cc')
-rw-r--r--base/os_compat_android.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/os_compat_android.cc b/base/os_compat_android.cc
index dc7922a0..b2756b2 100644
--- a/base/os_compat_android.cc
+++ b/base/os_compat_android.cc
@@ -9,7 +9,10 @@
#include <math.h>
#include <sys/stat.h>
#include <sys/syscall.h>
+
+#if !defined(__LP64__)
#include <time64.h>
+#endif
#include "base/rand_util.h"
#include "base/strings/string_piece.h"
@@ -37,7 +40,8 @@ int futimes(int fd, const struct timeval tv[2]) {
return syscall(__NR_utimensat, fd, NULL, ts, 0);
}
-// Android has only timegm64() and no timegm().
+#if !defined(__LP64__)
+// 32-bit Android has only timegm64() and not timegm().
// We replicate the behaviour of timegm() when the result overflows time_t.
time_t timegm(struct tm* const t) {
// time_t is signed on Android.
@@ -48,6 +52,7 @@ time_t timegm(struct tm* const t) {
return -1;
return result;
}
+#endif
// The following is only needed when building with GCC 4.6 or higher
// (i.e. not with Android GCC 4.4.3, nor with Clang).