From: <pat...@us...> - 2010-09-04 17:04:19
|
Revision: 664 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=664&view=rev Author: patrickh Date: 2010-09-04 17:04:13 +0000 (Sat, 04 Sep 2010) Log Message: ----------- Use std::tr1::unordered_map<T,H> with Visual C++ 9.0 and newer. Fall back on std::map<T> for older versions of Visual C++. This is based on a patch submitted by Ryan Pavlik. Modified Paths: -------------- branches/1.0/cppdom/cppdom.h Modified: branches/1.0/cppdom/cppdom.h =================================================================== --- branches/1.0/cppdom/cppdom.h 2010-09-04 16:55:09 UTC (rev 663) +++ branches/1.0/cppdom/cppdom.h 2010-09-04 17:04:13 UTC (rev 664) @@ -75,8 +75,15 @@ // Use fastest map available #if defined(CPPDOM_USE_HASH_MAP) -# if defined(__GNUC__) && (__GNUC__ >= 4) -# include <tr1/unordered_map> +# if defined(__GNUC__) && (__GNUC__ >= 4) || \ + defined(_MSC_VER) && _MSC_VER >= 1500 + +# if defined(__GNUC__) +# include <tr1/unordered_map> +# else +# include <unordered_map> +# endif + # include <map> namespace cppdom @@ -103,9 +110,12 @@ typedef std::hash_map<TagNameHandle,std::string> TagNameMap_t; typedef std::hash_map<std::string, TagNameHandle, HashString> NameToTagMap_t; } -# endif // # elif defined(__GNUC__) && (__GNUC__ >= 3) +# else +# undef CPPDOM_USE_HASH_MAP +# endif +#endif -#else // #if defined(CPPDOM_USE_HASH_MAP) +#if ! defined(CPPDOM_USE_HASH_MAP) # include <map> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |