Make cgi 7.8 ready

Builds under the latest platform and 7.8-RC2.

There's probably a less hack-y way to do this, I just wanted to
make it work.