The complex shear modulus of polymeric and small-molecule liquids