Move variables declaration after struct definitions, so that gcc knows the size of the variables. Fix build on netbsd-4.