summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2022-01-09 16:50:52 +0100
committerJens Geyer <Jens-G@users.noreply.github.com>2022-01-09 21:57:30 +0100
commit98a232577fa56bb703ea96b88cc6c5b9391178f0 (patch)
tree916efb58623cd23042ed192961ac4df9387c221c /compiler
parent39d7278ddffce27d45380c483a84d013f6db4d7b (diff)
downloadthrift-98a232577fa56bb703ea96b88cc6c5b9391178f0.tar.gz
THRIFT-5479 Add net 6 support
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cpp/src/thrift/generate/t_netstd_generator.cc5
-rw-r--r--compiler/cpp/src/thrift/generate/t_netstd_generator.h12
2 files changed, 15 insertions, 2 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
index 88f8da417..1f8e169da 100644
--- a/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.cc
@@ -304,7 +304,8 @@ void t_netstd_generator::reset_indent() {
void t_netstd_generator::start_netstd_namespace(ostream& out)
{
- out << "#pragma warning disable IDE0079 // remove unnecessary pragmas" << endl
+ out << "#nullable disable // suppress C# 8.0 nullable contexts (we still support earlier versions)" << endl
+ << "#pragma warning disable IDE0079 // remove unnecessary pragmas" << endl
<< "#pragma warning disable IDE1006 // parts of the code use IDL spelling" << endl
<< "#pragma warning disable IDE0083 // pattern matching \"that is not SomeType\" requires net5.0 but we still support earlier versions" << endl
<< endl;
@@ -862,7 +863,7 @@ void t_netstd_generator::generate_netstd_struct(t_struct* tstruct, bool is_excep
f_struct.open(f_struct_name.c_str());
- reset_indent();
+ reset_indent();
f_struct << autogen_comment() << netstd_type_usings() << netstd_thrift_usings() << endl;
generate_netstd_struct_definition(f_struct, tstruct, is_exception);
diff --git a/compiler/cpp/src/thrift/generate/t_netstd_generator.h b/compiler/cpp/src/thrift/generate/t_netstd_generator.h
index 47a704280..31226f245 100644
--- a/compiler/cpp/src/thrift/generate/t_netstd_generator.h
+++ b/compiler/cpp/src/thrift/generate/t_netstd_generator.h
@@ -150,6 +150,18 @@ public:
string convert_to_pascal_case(const string& str);
string get_enum_class_name(t_type* type);
+protected:
+ std::string autogen_comment() override {
+ return std::string("/**\n")
+ + " * <auto-generated>\n"
+ + " * " + autogen_summary() + "\n"
+ + " * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n"
+ + " * </auto-generated>\n"
+ " */\n"
+ ;
+ }
+
+
private:
string namespace_name_;
string namespace_dir_;