[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34555] trunk/lib/darwin-9.x.universal/ opencollada: opencollada rev 827.
Ton Roosendaal
ton at blender.org
Sat Jan 29 19:20:04 CET 2011
Revision: 34555
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34555
Author: ton
Date: 2011-01-29 18:20:03 +0000 (Sat, 29 Jan 2011)
Log Message:
-----------
opencollada rev 827. Provided by Jens Verwiebe
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=827
Modified Paths:
--------------
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUHashFunctions.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPcreCompiledPattern.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPrerequisites.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUhash_map.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADAFramework/COLLADAFWEdge.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADAFramework/COLLADAFWHashFunctions.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADAFramework/COLLADAFWTexture.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/COLLADASaxFWLCOLLADACsymbol.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/COLLADASaxFWLDocumentProcessor.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/COLLADASaxFWLFilePartLoader.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/COLLADASaxFWLFormulasLoader.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/COLLADASaxFWLIErrorHandler.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/COLLADASaxFWLLoader.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/COLLADASaxFWLSidAddress.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADASaxFrameworkLoader/generated15/COLLADASaxFWLLibraryKinematicsModelsLoader15.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADAStreamWriter/COLLADASWInputList.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADAStreamWriter/COLLADASWLibraryAnimations.h
trunk/lib/darwin-9.x.universal/opencollada/include/COLLADAStreamWriter/COLLADASWLibraryGeometries.h
trunk/lib/darwin-9.x.universal/opencollada/lib/libGeneratedSaxParser.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libMathMLSolver.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADABaseUtils.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADAFramework.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADASaxFrameworkLoader.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libbuffer.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libftoa.a
Modified: trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUHashFunctions.h
===================================================================
--- trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUHashFunctions.h 2011-01-29 17:56:34 UTC (rev 34554)
+++ trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUHashFunctions.h 2011-01-29 18:20:03 UTC (rev 34555)
@@ -11,8 +11,7 @@
#ifndef __COLLADABU_HASHFUNCTIONS_H__
#define __COLLADABU_HASHFUNCTIONS_H__
-#include "COLLADABUPrerequisites.h"
-#include "COLLADABUPlatform.h"
+#include "COLLADABUhash_map.h"
#include "COLLADABUURI.h"
@@ -35,25 +34,21 @@
} // namespace COLLADABU
-#if defined(COLLADABU_HAVE_TR1_UNORDERED_MAP) || defined(COLLADABU_OS_LINUX) || defined(COLLADABU_OS_MAC)
-#if defined(COLLADABU_HAVE_TR1_UNORDERED_MAP)
-namespace std { namespace tr1
-#else
-namespace __gnu_cxx
-#endif
+
+namespace COLLADABU_HASH_NAMESPACE_OPEN
{
- template<>
- struct hash<COLLADABU::URI>
- {
- size_t
- operator()(const COLLADABU::URI& uri) const
- { return COLLADABU::calculateHash(uri); }
- };
-#if defined(COLLADABU_HAVE_TR1_UNORDERED_MAP)
-}
-#endif
-} // namespace __gnu_cxx
-#endif
+ template<>
+ struct COLLADABU_HASH_FUN<COLLADABU::URI>
+ {
+ size_t operator() (const COLLADABU::URI& uri) const { return COLLADABU::calculateHash(uri); }
+#if defined(_MSC_VER) && _MSC_VER==1400
+ static const size_t bucket_size=4;
+ static const size_t min_buckets=8;
+ bool operator() (const COLLADABU::URI& uri1, const COLLADABU::URI& uri2) const { return uri1<uri2; }
+#endif
+ };
+} COLLADABU_HASH_NAMESPACE_CLOSE
+
#endif // __COLLADABU_HASHFUNCTIONS_H__
Modified: trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPcreCompiledPattern.h
===================================================================
--- trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPcreCompiledPattern.h 2011-01-29 17:56:34 UTC (rev 34554)
+++ trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPcreCompiledPattern.h 2011-01-29 18:20:03 UTC (rev 34555)
@@ -36,14 +36,6 @@
public:
- /** If the preprocessor flag COLLADABU_USE_PCRE_PRECOMPILED is set, @a pattern is ignored and @a compiledPattern
- is stored as compiled pattern. @a compiledPattern must persist at least as long as the PcreCompiledPattern
- object.
- If the preprocessor flag is not set, @a compiledPattern is ignored and the compiled pattern is created by
- compiling @a pattern.
- */
- PcreCompiledPattern( const char* pattern, const char* compiledPattern);
-
/** The compiled pattern is created by compiling @a pattern. The behavior of this constructor is independent of
COLLADABU_USE_PCRE_PRECOMPILED.*/
PcreCompiledPattern( const char* pattern );
@@ -52,7 +44,7 @@
virtual ~PcreCompiledPattern();
/** Returns the compiled pattern. */
- pcre* getPattern() const { return mCompiledPattern; }
+ pcre* getCompiledPattern() const;
private:
Modified: trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPrerequisites.h
===================================================================
--- trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPrerequisites.h 2011-01-29 17:56:34 UTC (rev 34554)
+++ trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUPrerequisites.h 2011-01-29 18:20:03 UTC (rev 34555)
@@ -3,7 +3,7 @@
This file is part of COLLADAFramework.
- Licensed under the MIT Open Source License,
+ Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/
@@ -16,84 +16,10 @@
#include <string>
#include <string.h>
-#include "COLLADABUPlatform.h"
-
namespace COLLADABU
{
typedef std::string String;
typedef std::wstring WideString;
}
-#define COLLADABU_HAVE_TR1_UNORDERED_MAP
-#ifndef COLLADABU_OS_WIN
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
-#undef COLLADABU_HAVE_TR1_UNORDERED_MAP
-#else
- #include <tr1/unordered_map>
- #include <tr1/unordered_set>
-#endif
-#else
-# undef COLLADABU_HAVE_TR1_UNORDERED_MAP
-# if defined(_MSC_VER) && (_MSC_VER >= 1500) \
- && defined(_MSC_FULL_VER) && \
- !defined(__SGI_STL_PORT) && \
- !defined(_STLPORT_VERSION) && \
- !defined(_RWSTD_VER_STR) && \
- !defined(_RWSTD_VER)
-# define COLLADABU_HAVE_TR1_UNORDERED_MAP
-# include <unordered_map>
-# include <unordered_set>
-# endif
-#endif
-#ifndef COLLADABU_HAVE_TR1_UNORDERED_MAP
-# if defined(COLLADABU_OS_LINUX) || defined(COLLADABU_OS_MAC)
-# include <ext/hash_map>
-# include <ext/hash_set>
-# else
-# include <hash_map>
-# include <hash_set>
-# endif
-#endif
-
-#ifdef COLLADABU_HAVE_TR1_UNORDERED_MAP
-//# include
-#else
-# ifdef COLLADABU_OS_LINUX
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
-# include <ext/hash_fun.h>
-#else
-# include <backward/hash_fun.h>
-#endif
-# include "COLLADABUURI.h"
-# elif (defined COLLADABU_OS_MAC)
-# include <ext/hash_fun.h>
-# include "COLLADABUURI.h"
-# endif
-#endif
-
-#ifndef COLLADABU_HAVE_TR1_UNORDERED_MAP
- namespace __gnu_cxx {
-
- template <>
- struct hash<std::string>
- {
- size_t operator() (const std::string& x) const
- {
- return hash<const char*>()(x.c_str());
- }
- };
-
- template < class _TYPE_ >
- struct hash< _TYPE_ *>
- {
- typedef _TYPE_* TYPE_PTR;
-
- size_t operator() ( TYPE_PTR x) const
- {
- return hash<intptr_t>()((intptr_t)x);
- }
- };
- }
-#endif
-
#endif //__COLLADABU_PREREQUISITES_H__
Modified: trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUhash_map.h
===================================================================
--- trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUhash_map.h 2011-01-29 17:56:34 UTC (rev 34554)
+++ trunk/lib/darwin-9.x.universal/opencollada/include/COLLADABaseUtils/COLLADABUhash_map.h 2011-01-29 18:20:03 UTC (rev 34555)
@@ -14,39 +14,107 @@
#include "COLLADABUPrerequisites.h"
#include "COLLADABUPlatform.h"
-// file to include the hash map platform independent
+// file to include the hash map platform independently
-namespace COLLADABU
-{
+#ifdef COLLADABU_OS_WIN
+ #if defined(_MSC_VER) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && !defined(_RWSTD_VER_STR) && !defined(_RWSTD_VER)
+ #if _MSC_VER <= 1400
+ #include <hash_map>
+ #include <hash_set>
+ #define COLLADABU_HASH_MAP stdext::hash_map
+ #define COLLADABU_HASH_SET stdext::hash_set
+ #define COLLADABU_HASH_NAMESPACE_OPEN stdext
+ #define COLLADABU_HASH_NAMESPACE_CLOSE
+ #define COLLADABU_HASH_FUN hash_compare // Unfortunately stdext::hash_compare is not the same as std::hash...
+ #elif _MSC_VER == 1500
+ #include <unordered_map>
+ #include <unordered_set>
-#ifdef COLLADABU_HAVE_TR1_UNORDERED_MAP
- using namespace std::tr1;
+ #define COLLADABU_HASH_MAP std::tr1::unordered_map
+ #define COLLADABU_HASH_SET std::tr1::unordered_set
+ #define COLLADABU_HASH_NAMESPACE_OPEN std { namespace tr1
+ #define COLLADABU_HASH_NAMESPACE_CLOSE }
+ #define COLLADABU_HASH_FUN hash
+ #else // _MSC_VER >= 1600
+ #include <unordered_map>
+ #include <unordered_set>
- template<class X, class Y >
- class hash_map : public std::tr1::unordered_map<X,Y>
- { public:
- hash_map(){}
- hash_map(const hash_map&a):std::tr1::unordered_map<X,Y>(a){}
- hash_map&operator=(const hash_map&a){std::tr1::unordered_map<X,Y>::operator=(*this,a);return this;}
- };
+ #define COLLADABU_HASH_MAP std::unordered_map
+ #define COLLADABU_HASH_SET std::unordered_set
+ #define COLLADABU_HASH_NAMESPACE_OPEN std
+ #define COLLADABU_HASH_NAMESPACE_CLOSE
+ #define COLLADABU_HASH_FUN hash
+ #endif
+ #endif
+#else // Linux or Mac
+ #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+ #include <ext/hash_map>
+ #include <ext/hash_set>
+ #include <ext/hash_fun.h>
- template<class X>
- class hash_set : public std::tr1::unordered_set<X>
- { public:
- hash_set(){}
- hash_set(const hash_set&a):std::tr1::unordered_set<X>(a){}
- hash_set&operator=(const hash_set&a){std::tr1::unordered_set<X>::operator=(*this,a);return this;}
- };
-#else
-# if defined(COLLADABU_OS_LINUX) || defined(COLLADABU_OS_MAC)
- using namespace __gnu_cxx;
-# else
- using namespace stdext;
-# endif
+ namespace __gnu_cxx // Do we need these specializations under Windows (with _MSC_VER==1400 (VS2005) and namespace "stdext") as well?
+ {
+ template <>
+ struct hash<std::string>
+ {
+ size_t operator() (const std::string& x) const
+ {
+ return hash<const char*>()(x.c_str());
+ }
+ };
+
+ template < class _TYPE_ >
+ struct hash< _TYPE_ *>
+ {
+ typedef _TYPE_* TYPE_PTR;
+
+ size_t operator() ( TYPE_PTR x) const
+ {
+ return hash<intptr_t>()((intptr_t)x);
+ }
+ };
+ }
+
+ #define COLLADABU_HASH_MAP __gnu_cxx::hash_map
+ #define COLLADABU_HASH_SET __gnu_cxx::hash_set
+ #define COLLADABU_HASH_NAMESPACE_OPEN __gnu_cxx
+ #define COLLADABU_HASH_NAMESPACE_CLOSE
+ #define COLLADABU_HASH_FUN hash
+ #else
+ #include <tr1/unordered_map>
+ #include <tr1/unordered_set>
+
+ #define COLLADABU_HASH_MAP std::tr1::unordered_map
+ #define COLLADABU_HASH_SET std::tr1::unordered_set
+ #define COLLADABU_HASH_NAMESPACE_OPEN std { namespace tr1
+ #define COLLADABU_HASH_NAMESPACE_CLOSE }
+ #define COLLADABU_HASH_FUN hash
+ #endif
#endif
+namespace COLLADABU
+{
+ // typedef COLLADABU_HASH_MAP<X, Y> hash_map<X, Y>; // Unfortunately, this is not possible...
+ template<class X, class Y>
+ class hash_map : public COLLADABU_HASH_MAP<X,Y>
+ {
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list