summaryrefslogtreecommitdiffstats
path: root/base/os_compat_nacl.cc
diff options
context:
space:
mode:
authorbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-25 00:56:14 +0000
committerbbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-25 00:56:14 +0000
commitc47ad0d702902a300be43d6e3ff348bc16efd26c (patch)
tree6c05e589798e3de0bdc7a6b2c3916bca2d6bd8fa /base/os_compat_nacl.cc
parent448d14a332acd24a5a3df93071d32caf39b98354 (diff)
downloadchromium_src-c47ad0d702902a300be43d6e3ff348bc16efd26c.zip
chromium_src-c47ad0d702902a300be43d6e3ff348bc16efd26c.tar.gz
chromium_src-c47ad0d702902a300be43d6e3ff348bc16efd26c.tar.bz2
Make more of base compile with the Native Client toolchain.
This is needed to get parts of the PPAPI proxy to compile as untrusted code. Leaving base.gypi unchanged even though this adds files, as they are only used by experimental target. BUG=none TEST=none Review URL: http://codereview.chromium.org/9465017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/os_compat_nacl.cc')
-rw-r--r--base/os_compat_nacl.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/base/os_compat_nacl.cc b/base/os_compat_nacl.cc
new file mode 100644
index 0000000..d38f9e0
--- /dev/null
+++ b/base/os_compat_nacl.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/os_compat_nacl.h"
+
+#include <stdlib.h>
+#include <time.h>
+
+extern "C" {
+// Native Client has no timegm().
+time_t timegm(struct tm* tm) {
+ time_t ret;
+ char* tz;
+ tz = getenv("TZ");
+ setenv("TZ", "", 1);
+ tzset();
+ ret = mktime(tm);
+ if (tz)
+ setenv("TZ", tz, 1);
+ else
+ unsetenv("TZ");
+ tzset();
+ return ret;
+}
+} // extern "C"
+