From: Karsten Heimrich Date: Wed, 3 Jun 2015 15:26:54 +0000 (+0200) Subject: Fix CLucene compile error with VS 2015. X-Git-Tag: v5.5.90+alpha1~6^2~12^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78beb4c7d337356d6f478d84b2e7b1fa227a2c3a;p=platform%2Fupstream%2Fqttools.git Fix CLucene compile error with VS 2015. Task-number: QTBUG-45961 Task-number: QTBUG-45976 Task-number: QTBUG-46344 Change-Id: Ic001298e96ae474a4939c445b7816a331135dd53 Reviewed-by: Joerg Bornemann --- diff --git a/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h b/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h index 439bc94..9779914 100644 --- a/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h +++ b/src/assistant/3rdparty/clucene/src/CLucene/StdHeader.h @@ -122,7 +122,10 @@ extern int _lucene_counter_break; //can set a watch on this #error "CLucene can't compile without the vector header" #endif -#if !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET) +#if !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_STD_UNORDERED_MAP) && defined(_CL_HAVE_STD_UNORDERED_SET) + #include + #include +#elif !defined(LUCENE_DISABLE_HASHING) && defined(_CL_HAVE_HASH_MAP) && defined(_CL_HAVE_HASH_SET) //hashing is all or nothing! #include #include diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h index 3bf91b3..6aac690 100644 --- a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerGcc.h @@ -45,6 +45,8 @@ #define CL_NS_HASHING(func) __gnu_cxx::func #define LUCENE_DISABLE_HASHING //we could enable this, but so far test show that the hashing is slower :( +#define CL_HASH_MAP hash_map +#define CL_HASH_SET hash_set //define the file functions #define fileSeek lseek diff --git a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h index 8578859..6b3f768 100644 --- a/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h +++ b/src/assistant/3rdparty/clucene/src/CLucene/config/CompilerMsvc.h @@ -27,8 +27,22 @@ #if (_MSC_VER < 1310) || defined(_STLPORT_VERSION) #define CL_NS_HASHING(func) std::func //the namespace is different on VC 7.0 #else - #define CL_NS_HASHING(func) stdext::func + #if _MSC_VER >= 1900 + #undef _CL_HAVE_EXT_HASH_MAP + #undef _CL_HAVE_EXT_HASH_SET + + #define CL_HASH_MAP unordered_map + #define CL_HASH_SET unordered_set + #define _CL_HAVE_STD_UNORDERED_MAP 1 + #define _CL_HAVE_STD_UNORDERED_SET 1 + #define CL_NS_HASHING(func) std::func + #else + #define CL_HASH_MAP hash_map + #define CL_HASH_SET hash_set + #define CL_NS_HASHING(func) stdext::func + #endif #endif + #define LUCENE_STATIC_CONSTANT_SYNTAX 1 #if _MSC_FULL_VER >= 140050320 diff --git a/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp b/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp index 8554194..7fab8d7 100644 --- a/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp +++ b/src/assistant/3rdparty/clucene/src/CLucene/debug/condition.cpp @@ -37,7 +37,7 @@ void _Cnd_OutDebug( const char* FormattedMsg, const char* StrTitle, const char* void __cnd_FormatDebug( const char* File, int32_t Line, int32_t Title, const char* Mes2, int32_t fatal ) { char M[512]; - char* StrTitle = NULL; + const char* StrTitle = NULL; if( Mes2 ) _snprintf(M,512,"file:%s line:%d\n%s",File,Line,Mes2); diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h index b31baba..5deb69d 100644 --- a/src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidList.h @@ -139,11 +139,11 @@ public: template -class CLHashList:public __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor> +class CLHashList:public __CLList<_kt, CL_NS_HASHING(CL_HASH_SET)<_kt,_Comparator> , _valueDeletor> { public: CLHashList ( const bool deleteValue=true ): - __CLList<_kt, CL_NS_HASHING(hash_set)<_kt,_Comparator> , _valueDeletor>(deleteValue) + __CLList<_kt, CL_NS_HASHING(CL_HASH_SET)<_kt,_Comparator> , _valueDeletor>(deleteValue) { } }; diff --git a/src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h index 1153a01..2236702 100644 --- a/src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h +++ b/src/assistant/3rdparty/clucene/src/CLucene/util/VoidMap.h @@ -153,16 +153,16 @@ public: //a CLSet with CLHashMap traits template class CLHashMap:public __CLMap<_kt,_vt, - CL_NS_STD(map)<_kt,_vt, _Compare>, + CL_NS_STD(map)<_kt,_vt, CL_Compare>, _KeyDeletor,_ValueDeletor> { - typedef typename CL_NS_STD(map)<_kt,_vt,_Compare> _base; - typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, _Compare>, + typedef typename CL_NS_STD(map)<_kt,_vt,CL_Compare> _base; + typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, CL_Compare>, _KeyDeletor,_ValueDeletor> _this; public: CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) @@ -180,10 +180,10 @@ template class CLHashMap:public __CLMap<_kt,_vt, - CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, + CL_NS_HASHING(CL_HASH_MAP)<_kt,_vt, _Hasher,_Equals>, _KeyDeletor,_ValueDeletor> { - typedef __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher,_Equals>, + typedef __CLMap<_kt,_vt, CL_NS_HASHING(CL_HASH_MAP)<_kt,_vt, _Hasher,_Equals>, _KeyDeletor,_ValueDeletor> _this; public: CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) @@ -201,10 +201,10 @@ template class CLHashMap:public __CLMap<_kt,_vt, - CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, + CL_NS_HASHING(CL_HASH_MAP)<_kt,_vt, _Hasher>, _KeyDeletor,_ValueDeletor> { - typedef __CLMap<_kt,_vt, CL_NS_HASHING(hash_map)<_kt,_vt, _Hasher>, + typedef __CLMap<_kt,_vt, CL_NS_HASHING(CL_HASH_MAP)<_kt,_vt, _Hasher>, _KeyDeletor,_ValueDeletor> _this; public: CLHashMap ( const bool deleteKey=false, const bool deleteValue=false ) @@ -218,15 +218,15 @@ public: //A collection that contains no duplicates //does not guarantee that the order will remain constant over time template class CLSet:public __CLMap<_kt,_vt, - CL_NS_STD(map)<_kt,_vt, _Compare>, + CL_NS_STD(map)<_kt,_vt, CL_Compare>, _KeyDeletor,_ValueDeletor> { - typedef typename CL_NS_STD(map)<_kt,_vt,_Compare> _base; - typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, _Compare>, + typedef typename CL_NS_STD(map)<_kt,_vt,CL_Compare> _base; + typedef __CLMap<_kt, _vt, CL_NS_STD(map)<_kt,_vt, CL_Compare>, _KeyDeletor,_ValueDeletor> _this; public: CLSet ( const bool deleteKey=false, const bool deleteValue=false )