Actually, the issue seems to be name changes in the header files
This causes TIOCNOTTY to end up being undefined.
That would not give the error message shown in
error: missing binary operator before token "long"
Line 131 is "#elif TIOCNOTTY". There's no 'long' there is TIOCNOTTY
undefined, it'd just evaluate to #elif 0. So my guess is that TIOCNOTTY
somewhere is defined to expand to an expression involving a (long) cast.