diff options
author | eugenis@chromium.org <eugenis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 20:25:00 +0000 |
---|---|---|
committer | eugenis@chromium.org <eugenis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 20:25:00 +0000 |
commit | d4124854e6263eeb59bd84160f7e710c537d5b8b (patch) | |
tree | 896adb56bac594a8b2fafaf9c08f132f925142cd /ipc/ipc_message_utils.cc | |
parent | a211f7dc26678a0300351347abba0ba2feeac5c4 (diff) | |
download | chromium_src-d4124854e6263eeb59bd84160f7e710c537d5b8b.zip chromium_src-d4124854e6263eeb59bd84160f7e710c537d5b8b.tar.gz chromium_src-d4124854e6263eeb59bd84160f7e710c537d5b8b.tar.bz2 |
Fix libcxx build.
In libcxx, vector<bool>::const_reference is not the same as bool. This requires
a new specialization of ParamTraits.
BUG=178409
R=tsepez@chromium.org,agl@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12943006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_utils.cc')
-rw-r--r-- | ipc/ipc_message_utils.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc index f3e40fa..a8ad2b0 100644 --- a/ipc/ipc_message_utils.cc +++ b/ipc/ipc_message_utils.cc @@ -404,8 +404,11 @@ void ParamTraits<std::vector<unsigned char> >::Log(const param_type& p, void ParamTraits<std::vector<bool> >::Write(Message* m, const param_type& p) { WriteParam(m, static_cast<int>(p.size())); + // Cast to bool below is required because libc++'s + // vector<bool>::const_reference is different from bool, and we want to avoid + // writing an extra specialization of ParamTraits for it. for (size_t i = 0; i < p.size(); i++) - WriteParam(m, p[i]); + WriteParam(m, static_cast<bool>(p[i])); } bool ParamTraits<std::vector<bool> >::Read(const Message* m, @@ -429,7 +432,7 @@ void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) { for (size_t i = 0; i < p.size(); ++i) { if (i != 0) l->push_back(' '); - LogParam((p[i]), l); + LogParam(static_cast<bool>(p[i]), l); } } |