diff options
Diffstat (limited to 'rust/bindgen.go')
-rw-r--r-- | rust/bindgen.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rust/bindgen.go b/rust/bindgen.go index a80a587f1..ffe532fcb 100644 --- a/rust/bindgen.go +++ b/rust/bindgen.go @@ -124,18 +124,20 @@ func (b *bindgenDecorator) getStdVersion(ctx ModuleContext, src android.Path) (s ctx.PropertyErrorf("c_std", "c_std and cpp_std cannot both be defined at the same time.") } - if String(b.ClangProperties.Cpp_std) != "" { + if b.ClangProperties.Cpp_std != nil { + isCpp = true if String(b.ClangProperties.Cpp_std) == "experimental" { stdVersion = cc_config.ExperimentalCppStdVersion - } else if String(b.ClangProperties.Cpp_std) == "default" { + } else if String(b.ClangProperties.Cpp_std) == "default" || String(b.ClangProperties.Cpp_std) == "" { stdVersion = cc_config.CppStdVersion } else { stdVersion = String(b.ClangProperties.Cpp_std) } } else if b.ClangProperties.C_std != nil { + isCpp = false if String(b.ClangProperties.C_std) == "experimental" { stdVersion = cc_config.ExperimentalCStdVersion - } else if String(b.ClangProperties.C_std) == "default" { + } else if String(b.ClangProperties.C_std) == "default" || String(b.ClangProperties.C_std) == "" { stdVersion = cc_config.CStdVersion } else { stdVersion = String(b.ClangProperties.C_std) |