I'm developing a software which is in C++ but that communicates with a C app through a shared header file containing the communication protocol. Since C is "more basic" than C++, I always need to write the header in C code (so C++ also gets it); otherwise it wouldn't work for the second app.
The problem is that I need to use a scope-quilifier such as the C++ namespace
s - which don't exist in C.
What are all the options to emulate the namespace
feature in C?
The only possibility I have seen so far is the one shown in this SO question, but unfortunately the answer is not clear enough and I would certainly like to know if there are other options. I also tried to use struct
s to do the job, without success (at least considering a struct
with an enum
erator).