fix gcc build, forward-declare structs in the header.

MSVC allows structs to be declared in a function signature, gcc wants
to know about them earlier.