You can hack it!
The library, call it fooLib
, thinks it's using some type bool
which it has the prerogative to define. To the library, bool
is just an identifier.
So, you can just force it to use another identifier instead:
#define bool fooLib_bool
#include "fooLib.h"
#undef bool
#undef true
#undef false
Now the compiler sees the offending line transformed to this:
typedef int fooLib_bool;
You're stuck with the interface using type fooLib_bool = int
instead of a real bool
, but that's impossible to work around, as the code might in fact rely on the properties of int
, and library binary would have been compiled with such an assumption baked in.