workaround for latest clang trunk (>=127962) which throws on template <> (extraneous 'template<>' in declaration of variable...)

This commit is contained in:
Dane Springmeyer 2011-03-20 19:18:03 +00:00
parent 720d9f216c
commit 3f219a7046
2 changed files with 8 additions and 1 deletions

View file

@ -77,7 +77,7 @@ private:
for (unsigned i = 0; i < EnumWrapper::MAX; ++i) for (unsigned i = 0; i < EnumWrapper::MAX; ++i)
{ {
// Register the strings allready defined for this enum. // Register the strings already defined for this enum.
base_type::value( EnumWrapper::get_string( i ), native_type( i ) ); base_type::value( EnumWrapper::get_string( i ), native_type( i ) );
} }
} }

View file

@ -319,9 +319,16 @@ operator>>(std::istream & is, mapnik::enumeration<ENUM, THE_MAX> & e)
/** Helper macro. Runs the verify() method during static initialization. /** Helper macro. Runs the verify() method during static initialization.
* @relates mapnik::enumeration * @relates mapnik::enumeration
*/ */
#if defined __clang__
#define IMPLEMENT_ENUM( name, strings ) \
const char ** name ::our_strings_ = strings; \
std::string name ::our_name_ = #name; \
bool name ::our_verified_flag_( name ::verify(__FILE__, __LINE__));
#else
#define IMPLEMENT_ENUM( name, strings ) \ #define IMPLEMENT_ENUM( name, strings ) \
template <> const char ** name ::our_strings_ = strings; \ template <> const char ** name ::our_strings_ = strings; \
template <> std::string name ::our_name_ = #name; \ template <> std::string name ::our_name_ = #name; \
template <> bool name ::our_verified_flag_( name ::verify(__FILE__, __LINE__)); template <> bool name ::our_verified_flag_( name ::verify(__FILE__, __LINE__));
#endif
#endif // MAPNIK_ENUMERATION_INCLUDED #endif // MAPNIK_ENUMERATION_INCLUDED