summaryrefslogtreecommitdiffstats
path: root/base/time_win.cc
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-16 09:54:23 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-16 09:54:23 +0000
commitfde269d9e7b0382de1796b416b72ba34a47900aa (patch)
tree4e2cb8d8fe4211ce8c5ec712774628bafa19f661 /base/time_win.cc
parent306923f4a29a9d593eb81d5a72ce6952344cc941 (diff)
downloadchromium_src-fde269d9e7b0382de1796b416b72ba34a47900aa.zip
chromium_src-fde269d9e7b0382de1796b416b72ba34a47900aa.tar.gz
chromium_src-fde269d9e7b0382de1796b416b72ba34a47900aa.tar.bz2
Switch on use of precompiled headers for VS 2008.
The precompiled header brings in more definitions of abs() for the base/time_win.cc file, and a hint to the compiler was needed to let VS 2008 build the file correctly. On VS 2008 only, the mini_installer target did not link correctly with precompiled headers enabled so this change disables them for that project. BUG=none TEST=it builds (esp. on Windows), existing tests pass Review URL: http://codereview.chromium.org/7910002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101474 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time_win.cc')
-rw-r--r--base/time_win.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/time_win.cc b/base/time_win.cc
index 9bb04de..9e6fe53 100644
--- a/base/time_win.cc
+++ b/base/time_win.cc
@@ -363,7 +363,12 @@ class HighResNowSingleton {
if (!IsUsingHighResClock())
return 0;
- return abs((UnreliableNow() - ReliableNow()) - skew_);
+ // The static_cast<long> is needed as a hint to VS 2008 to tell it
+ // which version of abs() to use. Other compilers don't seem to
+ // need it, including VS 2010, but to keep code identical we use it
+ // everywhere.
+ // TODO(joi): Remove the hint if/when we no longer support VS 2008.
+ return abs(static_cast<long>((UnreliableNow() - ReliableNow()) - skew_));
}
private: