[C++] Update the validator to skip structs in namespaces other than the current one. (#8324)

* [Python] Generate `.pyi` stub files when `--python-typing` is on.

To support this change, the following modifications were made:

-  added a new option to disable `numpy` helpers generation;
-  added a new flag to control the target Python version:

   `--python-version` can be one of the following:

   - `0.x.x` – compatible with any Python version;
   - `2.x.x` – compatible with Python 2;
   - `3.x.x` – compatible with Python 3.
-  added codegen utilities for Python;
-  added a note that the generated .py file is empty.

* [C++] Update the validator to skip structs in namespaces other than the current one.
This commit is contained in:
Anton Bobukh
2024-05-29 13:16:37 -07:00
committed by GitHub
parent 75f05d6389
commit 8755c35a18

View File

@@ -470,7 +470,11 @@ class CppGenerator : public BaseGenerator {
// Check that nativeName doesn't collide the name of another struct.
for (const auto &other_struct_def : parser_.structs_.vec) {
if (other_struct_def == struct_def) { continue; }
if (other_struct_def == struct_def ||
other_struct_def->defined_namespace !=
struct_def->defined_namespace) {
continue;
}
auto other_name = Name(*other_struct_def);
if (nativeName == other_name) {