Closed m8pple closed 2 years ago
This can be fixed by adding an additional type alias in Composer::formDevTPropsDStateD
:
void Composer::formDevTPropsDStateD(GraphI_t *graph, devTypStrings_t* dTypStrs)
{
...
std::string graphTName=graph->pT->Name();
...
if (devT->pStateD)
{
vars_h << "typedef struct " << devTName << "_state_t \n{\n";
vars_h << devT->pStateD->C_src();
vars_h << "\n} devtyp_" << devTName << "_state_t;\n\n";
// New alias
vars_h << "typedef devtyp_" << devTName << "_state_t "<<graphTName<<"_"<<devTName<<"_state_t;\n\n";
}
The same issue appears with ""{graphTypeId}_{deviceTypeId}_properties_t", and can be fixed in the same way.
This one is my bad. I missed making the change from devtyp_
in our v2 Softswitch to the appname one. Will look over your commits and fix.
This was done on development_dt10_branch (e992e8b), as otherwise I cant get through parsing through to compilation. The branch has the current 1.0.0-alpha merged in.
According to the v4 spec, there should be a type called
"{graphTypeId}_{deviceTypeId}_state_t"
which allows one to refer to the type-name for a given state:https://github.com/POETSII/poets_improvement_proposals/blob/2a355282f3aa3912bdacf4ec50bf25199bdf310d/proposed/PIP-0020/virtual-graph-schema-v4.rnc#L402-L412
It looks like there is an internal type called
devtyp_{deviceTypeId}_state_t
, but no alias for the implementation independent name.In cases where the shared code uses the implementation independent name, it fails to compile.
For example:
With microlog: