@@ -9,18 +9,6 @@ extern "C" {
99
1010using i18n::phonenumbers::PhoneNumber;
1111
12−// libphonenumber versions < 8.6.0 do not define CountryCodeSource::UNSPECIFIED
13−// The value PN_UNSPECIFIED contains CountryCodeSource::UNSPECIFIED if it is
14−// defined, otherwise 0 (the value used in the newer versions).
15−template<typename T, typename = void>
16−struct check_UNSPECIFIED: std::integral_constant<T, static_cast<T>(0)>
17−{};
18−template<typename T>
19−struct check_UNSPECIFIED<T, void_t<decltype(T::UNSPECIFIED)>>:
20− std::integral_constant<T, T::UNSPECIFIED>
21−{};
22−static constexpr auto PN_UNSPECIFIED = check_UNSPECIFIED<PhoneNumber::CountryCodeSource>::value;
23−
2412static PhoneNumber::CountryCodeSource marshal_country_code_source(country_code_source value)
2513{
2614 static_assert(is_same_enum<
@@ -32,7 +20,7 @@ static PhoneNumber::CountryCodeSource marshal_country_code_source(country_code_s
3220 FROM_DEFAULT_COUNTRY
3321 >,
3422 enum_values<PhoneNumber::CountryCodeSource,
35− PN_UNSPECIFIED,
23+ PhoneNumber::UNSPECIFIED,
3624 PhoneNumber::FROM_NUMBER_WITH_PLUS_SIGN,
3725 PhoneNumber::FROM_NUMBER_WITH_IDD,
3826 PhoneNumber::FROM_NUMBER_WITHOUT_PLUS_SIGN,