[Tizen 6.0] Enable build with GCC 9.2
[platform/upstream/libphonenumber.git] / tools / cpp / src / cpp-build / generate_geocoding_data.cc
index 22ae38e..c720b43 100644 (file)
@@ -399,10 +399,14 @@ void WritePrefixesDescriptions(const map<string, string>& prefix_var_names,
           "};\n"
           "\n"
           "const PrefixDescriptions* prefixes_descriptions[] = {\n");
+if(prefix_var_names.size() > 0) {
   for (map<string, string>::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<int32, set<string> >& languages,
     countries.push_back(country_code);
   }
 
-  fprintf(output,
-          "\n"
-          "const CountryLanguages* countries_languages[] = {\n");
-  for (vector<string>::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<string>::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"