Closed burak-yildizoz closed 1 month ago
It would be better if it uses the outermost module name.
Actually, having dealt with this exact issue, it is preferred that header guards use the entire module namespace. This avoids issues such as some::company::namespace::HelloMessage
and some::other::company::namespace::HelloMessage
producing the same header guard and being exclusively includable within the same C++ application.
All of that being said, I believe this issue actually belongs to the FastDDSGen issue board since it applies to the code generated using FastDDSGen.
Hi @burak-yildizoz thanks for your report,
As @brianwing90 said, this is an issue of Fast DDS-Gen so I'll be moving it there.
I'm having the same issue. Any planned updates for this problem?
Hi, Fast DDS Gen in master
branch uses java string toUpperCase()
method in the guard generation.
We are not planning to change it in shot-middle terms.
Maybe running the Fast DDS Gen from a docker with the desired Locale suits your needs.
As requested by issue eProsima/Fast-DDS#195, the generated C++ code honors the module name in the header guard. However, the technique used to convert lowercase to uppercase must be locale-free. For instance, if the module name is
invalid
, the generated header guard becomesİNVALİD
in Turkish locale.toUpperCase
method in commitf058a03
should be replaced withstd::toupper
. Another issue is that if there are nested modules, the header guard uses the innermost module name of the last struct. It would be better if it uses the outermost module name.