summaryrefslogtreecommitdiffstats
path: root/webkit/glue/web_io_operators.h
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 20:03:11 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 20:03:11 +0000
commit1599077a645a03c31c09efe57befaefbe00c958a (patch)
treedcf0702d4e1a241ce69e4e6a9968992f42ed4b68 /webkit/glue/web_io_operators.h
parentf27a0b59065835a9fe6f9a30681c36f14fe9edc3 (diff)
downloadchromium_src-1599077a645a03c31c09efe57befaefbe00c958a.zip
chromium_src-1599077a645a03c31c09efe57befaefbe00c958a.tar.gz
chromium_src-1599077a645a03c31c09efe57befaefbe00c958a.tar.bz2
Clang: make DCHECK_EQ(string16, string16) work.
The problem is that string16 is a typedef for a std::basic_string with a custom base::char_traits, hence ADL looks for operator<< only in std and base, not in the global namespace. Since adding stuff to the global namespace isn't permitted, move the operator to namespace base instead. Also give WebString an explicit operator<< because clang can't figure out that it can use WebString's |operator string16| to print WebStrings. string16 is just wstring on windows, and gtest has special code to make printing wstrings to non-wide ostreams work already, so nothing is required on windows. Fix a few other minor issues. Based on a patch by hans@chromium.org BUG=57294 TEST=still compiles with gcc, fewer build errors in tests with clang Review URL: http://codereview.chromium.org/3515003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/web_io_operators.h')
-rw-r--r--webkit/glue/web_io_operators.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/webkit/glue/web_io_operators.h b/webkit/glue/web_io_operators.h
new file mode 100644
index 0000000..ba10ee0
--- /dev/null
+++ b/webkit/glue/web_io_operators.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2010 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.
+
+#ifndef WEBKIT_GLUE_WEB_IO_OPERATORS_H_
+#define WEBKIT_GLUE_WEB_IO_OPERATORS_H_
+
+#include <iosfwd>
+
+#include "build/build_config.h"
+
+#if defined(WCHAR_T_IS_UTF32)
+namespace WebKit {
+class WebString;
+std::ostream& operator<<(std::ostream& out, const WebString& s);
+} // namespace WebKit
+#endif // defined(WCHAR_T_IS_UTF32)
+
+#endif // WEBKIT_GLUE_WEB_IO_OPERATORS_H_