We have two projects. One project is C++ (say SourceA) and other is only C (say SourceB). Both have different repository but few header files are common between them. While compiling SourceB I copy common header files from SourceA.
Since AsourceA is C++ code, I wanted user to prevent writing any C++ code in common header files, so that it will also compile in SourceB. Is there any way to do so? I tried using extern "c"{}
but C++ code inside extern "C"
is not giving error.
I am using Eclipse IDE for SourceA, if there is any setting Eclipse then it can also work.
In general how people handle this problem?