Nullable java (#4455)

* add _Nullable Support for C++ interface

* generate @Nullable for Java generated code
This commit is contained in:
Yonggang Li
2017-10-16 09:24:11 -07:00
committed by Wouter van Oortmerssen
parent a1b5f565d9
commit 01bac38c84
5 changed files with 28 additions and 11 deletions

View File

@@ -127,7 +127,7 @@ class CppGenerator : public BaseGenerator {
code_ += "#define " + include_guard;
code_ += "";
if (parser_.opts.clang_nullable) {
if (parser_.opts.gen_nullable) {
code_ += "#pragma clang system_header\n\n";
}
@@ -433,7 +433,7 @@ class CppGenerator : public BaseGenerator {
}
std::string NullableExtension() {
return parser_.opts.clang_nullable ? " _Nullable " : "";
return parser_.opts.gen_nullable ? " _Nullable " : "";
}
static std::string NativeName(const std::string &name, const StructDef *sd, const IDLOptions & opts) {