Commit 248da996 authored by David Gobbi's avatar David Gobbi

Make wrappers ignore scoped class definitions.

Whenever a scoped class was defined, e.g. "struct somescope::someclass"
followed by the definition, the wrappers would add it to the current
namespace as "somescope::someclass" instead of adding "someclass" to the
"somescope" namespace.  As a partial fix, simply ignore such classes.

Change-Id: Iacd18b9042e53f4d3ed341714e26d3cf1b7fab2f
parent 3aeccaee
......@@ -10843,15 +10843,24 @@ void start_class(const char *classname, int is_struct_or_union)
currentClass->ItemType = VTK_UNION_INFO;
}
if (classname && classname[strlen(classname)-1] != '>')
if (classname && classname[0] != '\0')
{
if (outerClass)
/* if name of class being defined contains "::" or "<..>", then skip it */
const char *cp = classname;
while (*cp != '\0' && *cp != ':' && *cp != '>')
{
vtkParse_AddClassToClass(outerClass, currentClass);
cp++;
}
else
if (*cp == '\0')
{
vtkParse_AddClassToNamespace(currentNamespace, currentClass);
if (outerClass)
{
vtkParse_AddClassToClass(outerClass, currentClass);
}
else
{
vtkParse_AddClassToNamespace(currentNamespace, currentClass);
}
}
}
......
......@@ -3436,15 +3436,24 @@ void start_class(const char *classname, int is_struct_or_union)
currentClass->ItemType = VTK_UNION_INFO;
}
if (classname && classname[strlen(classname)-1] != '>')
if (classname && classname[0] != '\0')
{
if (outerClass)
/* if name of class being defined contains "::" or "<..>", then skip it */
const char *cp = classname;
while (*cp != '\0' && *cp != ':' && *cp != '>')
{
vtkParse_AddClassToClass(outerClass, currentClass);
cp++;
}
else
if (*cp == '\0')
{
vtkParse_AddClassToNamespace(currentNamespace, currentClass);
if (outerClass)
{
vtkParse_AddClassToClass(outerClass, currentClass);
}
else
{
vtkParse_AddClassToNamespace(currentNamespace, currentClass);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment