aboutsummaryrefslogtreecommitdiffhomepage
path: root/tdtl
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2021-10-20 01:01:22 +0300
committerlevlam <levlam@telegram.org>2021-10-20 01:01:22 +0300
commitd225bdf073c68d42536d42e46ddf8648538555b9 (patch)
tree68e07a17bac113b4cf0d4061e80001a176f16b18 /tdtl
parent41cc287d666b7bad6d864c1c955e5f9b3291edbd (diff)
Improve tdtl C++03 compatibility.
Diffstat (limited to 'tdtl')
-rw-r--r--tdtl/td/tl/tl_config.cpp2
-rw-r--r--tdtl/td/tl/tl_generate.cpp2
-rw-r--r--tdtl/td/tl/tl_generate.h1
3 files changed, 3 insertions, 2 deletions
diff --git a/tdtl/td/tl/tl_config.cpp b/tdtl/td/tl/tl_config.cpp
index c42affd0a..8d2f442c2 100644
--- a/tdtl/td/tl/tl_config.cpp
+++ b/tdtl/td/tl/tl_config.cpp
@@ -40,7 +40,7 @@ void tl_config::add_type(tl_type *type) {
}
tl_type *tl_config::get_type(std::int32_t type_id) const {
- auto it = id_to_type.find(type_id);
+ std::map<std::int32_t, tl_type *>::const_iterator it = id_to_type.find(type_id);
assert(it != id_to_type.end());
return it->second;
}
diff --git a/tdtl/td/tl/tl_generate.cpp b/tdtl/td/tl/tl_generate.cpp
index 116cc1073..1747bc5f0 100644
--- a/tdtl/td/tl/tl_generate.cpp
+++ b/tdtl/td/tl/tl_generate.cpp
@@ -857,7 +857,7 @@ bool write_tl_to_file(const tl_config &config, const std::string &file_name, con
tl_string_outputer out;
write_tl(config, out, w);
- auto old_file_contents = get_file_contents(file_name, "rb");
+ std::string old_file_contents = get_file_contents(file_name, "rb");
if (!w.is_documentation_generated()) {
old_file_contents = remove_documentation(old_file_contents);
}
diff --git a/tdtl/td/tl/tl_generate.h b/tdtl/td/tl/tl_generate.h
index d33db4077..57cfaa3fe 100644
--- a/tdtl/td/tl/tl_generate.h
+++ b/tdtl/td/tl/tl_generate.h
@@ -18,6 +18,7 @@ namespace tl {
void write_tl(const tl_config &config, tl_outputer &out, const TL_writer &w);
tl_config read_tl_config_from_file(const std::string &file_name);
+
bool write_tl_to_file(const tl_config &config, const std::string &file_name, const TL_writer &w);
} // namespace tl