Check that __cplusplus is defined before testing its value to avoid warnings when compiling C code, e.g. regex library. Notice that in master a check for __cplusplus covering a bigger part of this file was added to solve the same problem, but it doesn't seem like a good idea to stop defining other symbols which had been previously defined in 3.0, so keep this check as narrow as possible here.