Skip to content

Commit

Permalink
Silence -Wundefined-var-template warnings in enumeration.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp authored and lightmare committed Oct 13, 2016
1 parent 75024c0 commit b27cddc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/mapnik/enumeration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ class MAPNIK_DECL enumeration {
}
for (unsigned i = 0; i < THE_MAX; ++i)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundefined-var-template"
if (str_copy == our_strings_[i])
#pragma GCC diagnostic pop
{
value_ = static_cast<ENUM>(i);
if (deprecated)
Expand All @@ -199,14 +202,20 @@ class MAPNIK_DECL enumeration {
return;
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundefined-var-template"
throw illegal_enum_value(std::string("Illegal enumeration value '") +
str + "' for enum " + our_name_);
#pragma GCC diagnostic pop
}

/** Returns the current value as a string identifier. */
std::string as_string() const
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundefined-var-template"
return our_strings_[value_];
#pragma GCC diagnostic pop
}

/** Static helper function to iterate over valid identifiers. */
Expand Down

0 comments on commit b27cddc

Please sign in to comment.