From 14641095dbeafe155a1d1000c0f0f6ca77a70b2c Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 30 May 2012 11:41:06 +0200 Subject: 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 --- src/3rdparty/clucene/src/CLucene/StdHeader.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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 //////////////////////////////////////////////////////// -- cgit v0.12