This makes it possible to build this code with -fno-rtti. Patch by Julian Seward
Third time's the charm. The first upload had an error, then I accidentally deleted the second one.