You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using multiple eRPC files to generate different server / client connections in one project.
We're using the new namespace feature of 1.12.0 and assign each eRPC file it's own namespace.
As long as we do not have conflicting type names, we do not have any problems.
But as binary_t is implicitly generated for binary, we can't solve this issue by our self.
To Reproduce
Create two .erpc files with both containing a function that uses binary and a different @namespace(".....").
Then include both server (and or clients, so we get the "...common.hpp" file of both included) in on C++ file.
Expected behavior
The code generator, generates code without type conflicts / no compile errors
I think it should be easy by adding the namespace also to the ...._common.hpp file, while generating it via the code generator.
Desktop (please complete the following information)
Just for other having this issue and can't wait for the fix:
I did try some workarounds (in C++17) and found a ugly one
You need to include (at least) the common header in your desired namespace before including others (this means that you need to be very careful with include order).
When fixing this, it should be considered how to handle the constants, as for C usage they need to be global (no namespace). In C++ this extern constants (which are to for some reason weak?) should better be namespaced constexpr, so they can be used in the function prototypes / interface definition e.g. for array sizes
Edit:
weak is there most likely when you compile client and server together to prevent redefinition (and to save a common cpp file just for the constant values).
I'm facing this issue as well, and can't find a workaround. The namespace thing I'm not sure I understand. I currently have the client and server has part of the same component, so it would be in the same namespace. I am switching from an older implementation of eRPC which didn't have this issue.
Describe the bug
We're using multiple eRPC files to generate different server / client connections in one project.
We're using the new namespace feature of 1.12.0 and assign each eRPC file it's own namespace.
As long as we do not have conflicting type names, we do not have any problems.
But as
binary_t
is implicitly generated forbinary
, we can't solve this issue by our self.To Reproduce
Create two
.erpc
files with both containing a function that usesbinary
and a different@namespace(".....")
.Then include both server (and or clients, so we get the "...common.hpp" file of both included) in on C++ file.
Expected behavior
The code generator, generates code without type conflicts / no compile errors
I think it should be easy by adding the namespace also to the
...._common.hpp
file, while generating it via the code generator.Desktop (please complete the following information)
The text was updated successfully, but these errors were encountered: