summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 00:02:29 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 00:02:29 +0000
commit1f88b516c54bf39058785d16dacdb3b0c5262b04 (patch)
tree72ac70255b2b3c8be6260b1e45ae6b98d48ed103 /base
parent05100ec8f5b7926f990c6f61b04331fb4be4e99c (diff)
downloadchromium_src-1f88b516c54bf39058785d16dacdb3b0c5262b04.zip
chromium_src-1f88b516c54bf39058785d16dacdb3b0c5262b04.tar.gz
chromium_src-1f88b516c54bf39058785d16dacdb3b0c5262b04.tar.bz2
Base: A few more changes to build base.dll
BUG=76996 TEST=none Review URL: http://codereview.chromium.org/6784002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/logging.cc19
-rw-r--r--base/logging.h4
-rw-r--r--base/string_piece.cc7
-rw-r--r--base/time.h2
4 files changed, 20 insertions, 12 deletions
diff --git a/base/logging.cc b/base/logging.cc
index e36a168b..e5c8c8d 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -39,10 +39,11 @@ typedef FILE* FileHandle;
typedef pthread_mutex_t* MutexHandle;
#endif
+#include <algorithm>
+#include <cstring>
#include <ctime>
#include <iomanip>
-#include <cstring>
-#include <algorithm>
+#include <ostream>
#include "base/base_switches.h"
#include "base/command_line.h"
@@ -815,3 +816,15 @@ void RawLog(int level, const char* message) {
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
return out << WideToUTF8(std::wstring(wstr));
}
+
+namespace base {
+
+// This was defined at the beginnig of this file.
+#undef write
+
+std::ostream& operator<<(std::ostream& o, const StringPiece& piece) {
+ o.write(piece.data(), static_cast<std::streamsize>(piece.size()));
+ return o;
+}
+
+} // namespace base
diff --git a/base/logging.h b/base/logging.h
index 7721a93..0e78e1a 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -938,8 +938,8 @@ namespace base {
class StringPiece;
-// allow StringPiece to be logged (needed for unit testing).
-extern std::ostream& operator<<(std::ostream& o, const StringPiece& piece);
+// Allows StringPiece to be logged.
+BASE_API std::ostream& operator<<(std::ostream& o, const StringPiece& piece);
} // namespace base
diff --git a/base/string_piece.cc b/base/string_piece.cc
index 3ccb4f0..bf6291c 100644
--- a/base/string_piece.cc
+++ b/base/string_piece.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
// Copied from strings/stringpiece.cc with modifications
@@ -12,11 +12,6 @@ namespace base {
typedef StringPiece::size_type size_type;
-std::ostream& operator<<(std::ostream& o, const StringPiece& piece) {
- o.write(piece.data(), static_cast<std::streamsize>(piece.size()));
- return o;
-}
-
bool operator==(const StringPiece& x, const StringPiece& y) {
if (x.size() != y.size())
return false;
diff --git a/base/time.h b/base/time.h
index a19a826..cc99faa 100644
--- a/base/time.h
+++ b/base/time.h
@@ -205,7 +205,7 @@ class BASE_API Time {
// Represents an exploded time that can be formatted nicely. This is kind of
// like the Win32 SYSTEMTIME structure or the Unix "struct tm" with a few
// additions and changes to prevent errors.
- struct Exploded {
+ struct BASE_API Exploded {
int year; // Four digit year "2007"
int month; // 1-based month (values 1 = January, etc.)
int day_of_week; // 0-based day of week (0 = Sunday, etc.)