Macro to disable RTTI

This patch adds support for compiling without rtti (-fno-rtti) by adding a macro to replace dynamic_cast with static_cast. 

static_cast is enough to perform a downcast, but it will not perform a runtime check, therefore it should only be activated when the user is sure of what he does.