compilation fixes for gcc on Solaris and AIX