My C++ program needs to use an external C library. Therefore, I'm using the
extern "C"
{
#include <library_header.h>
}
syntax for every module I need to use.
It worked fine until now. A module is using the this name for some variables in one of its header file. The C library itself is compiling fine because, from what I know, this has never been a keyword in C.
But despite my usage of the extern "C" syntax, I'm getting errors from my C++ program when I include that header file.
If I rename every this in that C library header file with something like _this, everything seems to work fine.
The question is:
Shouldn't the extern "C" syntax be enough for backward compatibility, at least at syntax level, for an header file? Is this an issue with the compiler?