Closed simoneruffini closed 3 years ago
Probably the best solution is to prefix the c ids with the network name, thanks c for your inexistent namespaces.
An alternative is to use the network merge runtime feature to create a single network from two different ones, however this will return an error if two messages with different properties are present in two different networks.
Instead of using ifndef
s we can just use #pragma once
and be done with it. Still, it's better if the filenames reflect the network's name
I'll just prefix every generated name with a short version of the network name so we are sure the will be no collisions.
P.S. namespaces are for pussies
fixed with 5fb437bb0830a3ad963ae97b3cd5e471a96f0bde
Thanks. But after some other thinking since C does not have the concept of namespaces (because all functions etc... should be prefixed with the module name), me and @Bonnee think that is better that every variable that will have a define and every function generated with flatcc should be prefixed with the netwrok name.
For example in bms-hv we could have two identical messages (HV_VOLATAGES) both for can1 and for carrellino. This would mean that if the same serialization/deserialization messages appear in flatcc than a compile time error would occur.
Ok, you can open a new issue explaining features you would like to see
When two networks are used by and application (let's say ECU) they use two heders-gen headers so every item/name that has the same name is potentially a problem. One of those is the preguard on header files:
In this status I cannot use the id's of primary and secondary bcause one of them will not be included by the compiler.
Solution: Avoid same name generation on different files, prefix them with the name of the network.
This is not only for this instance but for every name, so maybe ID's to must be prefixed with the network name to avoid collisions