From: chakradhar Date: Wed, 8 Jan 2020 14:06:51 +0000 (+0530) Subject: [Tizen 6.0] Enable build with GCC 9.2 X-Git-Tag: accepted/tizen/6.0/unified/20201030.105716^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Flibphonenumber.git;a=commitdiff_plain;h=7702d7e43d65197d961dd6097785c880b9e213f4 [Tizen 6.0] Enable build with GCC 9.2 Change-Id: I318114a821e23db4d1c6112ba3b9e4316e3d720a --- diff --git a/tools/cpp/src/cpp-build/generate_geocoding_data.cc b/tools/cpp/src/cpp-build/generate_geocoding_data.cc index 22ae38e..c720b43 100644 --- a/tools/cpp/src/cpp-build/generate_geocoding_data.cc +++ b/tools/cpp/src/cpp-build/generate_geocoding_data.cc @@ -399,10 +399,14 @@ void WritePrefixesDescriptions(const map& prefix_var_names, "};\n" "\n" "const PrefixDescriptions* prefixes_descriptions[] = {\n"); +if(prefix_var_names.size() > 0) { for (map::const_iterator it = prefix_var_names.begin(); it != prefix_var_names.end(); ++it) { fprintf(output, " &%s,\n", it->second.c_str()); } +}else{ + fprintf(output, "%s", "0"); +} fprintf(output, "};\n" "\n"); @@ -466,14 +470,15 @@ bool WriteCountryLanguages(const map >& languages, countries.push_back(country_code); } - fprintf(output, - "\n" - "const CountryLanguages* countries_languages[] = {\n"); - for (vector::const_iterator - it_languages_var = country_languages_vars.begin(); + fprintf(output, "\n" "const CountryLanguages* countries_languages[] = {\n"); + if( country_languages_vars.size() > 0) { + for (vector::const_iterator it_languages_var = country_languages_vars.begin(); it_languages_var != country_languages_vars.end(); ++it_languages_var) { fprintf(output, " &%s,\n", it_languages_var->c_str()); } +}else{ + fprintf(output, "%s", "0"); +} fprintf(output, "};\n" "\n"