I need to include some headers originally written in C in a C++ project. In the header files, the restrict keyword is used, which leads to a syntax error for C++.
I am looking for a preprocessor macro which checks whether I am compiling with a C++ compiler and removes the restrict keyword in this case.
should do it.
restrictis not a keyword in C++, so#defineing it to nothing is unproblematic there.Or, as Arne Mertz suggested, better still, have
where you include the C headers in your C++ source.