The source-flattener.py script is omitting the closing brace of the extern "C" { directive. The directive then encloses any C++ source code where the flattened erfa.h is included and breaks compilation.
The end of the flattened erfa.h should look like the following:
...
void eraS2xpv(double s1, double s2, double pv[2][3], double spv[2][3]);
void eraSxp(double s, double p[3], double sp[3]);
void eraSxpv(double s, double pv[2][3], double spv[2][3]);
#ifdef __cplusplus
}
#endif
#endif