Generalized PT symmetry and real spectra