From: Bradley T. Hughes Date: Wed, 30 May 2012 09:41:06 +0000 (+0200) Subject: clucene: Compile with clang's libc++ X-Git-Tag: accepted/tizen/20131212.181521~301 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc35938d0d49b04bf98feda3e85da186ecc8184d;p=platform%2Fupstream%2Fqttools.git 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. Change-Id: I5700f6a221ee0667d4a3bb85110f6fea17a121bf Reviewed-by: Thiago Macieira --- diff --git a/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h b/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h index fbb3fd9..224d400 100644 --- a/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h +++ b/src/assistant/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 ////////////////////////////////////////////////////////