Portability fixes from building on ancient Sparc Solaris 32-bit.