summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-05-30 09:41:06 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-16 10:38:12 (GMT)
commit14641095dbeafe155a1d1000c0f0f6ca77a70b2c (patch)
tree8b306e7642d20d1a92aeb00902dc55b9adef747f /src/3rdparty
parent0de22e80ac645afc3793419300d6271d95809196 (diff)
downloadQt-14641095dbeafe155a1d1000c0f0f6ca77a70b2c.zip
Qt-14641095dbeafe155a1d1000c0f0f6ca77a70b2c.tar.gz
Qt-14641095dbeafe155a1d1000c0f0f6ca77a70b2c.tar.bz2
clucene: Compile with clang's libc++
When using clang's libc++, the 'using namespace std;' in CLucene's StdHeader.h causes ambiguity between wcschr() from wchar.h and std::wcschr() from cwchar (which is automatically included by libc++). The only symbols used from the std namespace are std::min() and std::max() so only pull these in, not the whole std namespace. Cherry-picked from qttools/bc35938d0d49b04bf98feda3e85da186ecc8184d. Change-Id: Ife6647df795f59a5feebd5c1aa3eebe7446ec720 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/clucene/src/CLucene/StdHeader.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/3rdparty/clucene/src/CLucene/StdHeader.h b/src/3rdparty/clucene/src/CLucene/StdHeader.h
index fbb3fd9..224d400 100644
--- a/src/3rdparty/clucene/src/CLucene/StdHeader.h
+++ b/src/3rdparty/clucene/src/CLucene/StdHeader.h
@@ -463,8 +463,16 @@ void CLDebugBreak(); //define a debugbreak function
//use std namespace
#ifndef LUCENE_NO_STDC_NAMESPACE
+#ifdef _LIBCPP_VERSION
+// clang's libc++ pulls in cwchar, clucene pulls in wchar.h and the entire std
+// namespace which causes ambiguity between ::wcschar() and std::wcschar(), but
+// clucene is only using std::min() and std::max()
+using std::min;
+using std::max;
+#else
using namespace std;
#endif
+#endif
////////////////////////////////////////////////////////