Commit a93b6256 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Compile with msvc.

parent bdb4e48e
...@@ -41,18 +41,11 @@ ...@@ -41,18 +41,11 @@
#include <QtDebug> #include <QtDebug>
QT_BEGIN_NAMESPACE
uint qHash(const CPlusPlus::LookupItem &key)
{
const uint h1 = qHash(key.type().type());
const uint h2 = qHash(key.lastVisibleSymbol());
return ((h1 << 16) | (h1 >> 16)) ^ h2;
}
QT_END_NAMESPACE
uint CPlusPlus::qHash(const CPlusPlus::LookupItem &key) uint CPlusPlus::qHash(const CPlusPlus::LookupItem &key)
{ {
return QT_PREPEND_NAMESPACE(qHash)(key); const uint h1 = QT_PREPEND_NAMESPACE(qHash)(key.type().type());
const uint h2 = QT_PREPEND_NAMESPACE(qHash)(key.lastVisibleSymbol());
return ((h1 << 16) | (h1 >> 16)) ^ h2;
} }
using namespace CPlusPlus; using namespace CPlusPlus;
......
...@@ -232,8 +232,10 @@ uint qHash(const CPlusPlus::LookupItem &result); ...@@ -232,8 +232,10 @@ uint qHash(const CPlusPlus::LookupItem &result);
} // end of namespace CPlusPlus } // end of namespace CPlusPlus
QT_BEGIN_NAMESPACE #if defined(Q_CC_MSVC) && _MSC_VER <= 1300
uint qHash(const CPlusPlus::LookupItem &result); //this ensures that code outside QmlJS can use the hash function
QT_END_NAMESPACE //it also a workaround for some compilers
inline uint qHash(const CPlusPlus::LookupItem &item) { return CPlusPlus::qHash(item); }
#endif
#endif // CPLUSPLUS_LOOKUPCONTEXT_H #endif // CPLUSPLUS_LOOKUPCONTEXT_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment