diff --git a/tools/miniswig/create_wrapper.cpp b/tools/miniswig/create_wrapper.cpp index 25cbab530d9..2e1b90b066c 100644 --- a/tools/miniswig/create_wrapper.cpp +++ b/tools/miniswig/create_wrapper.cpp @@ -299,7 +299,7 @@ WrapperCreator::create_function_wrapper(Class* _class, Function* function) out << ind << ind << "sq_throwerror(vm, _SC(\"'" << function->name << "' called without instance\"));\n"; out << ind << ind << "return SQ_ERROR;\n"; out << ind << "}\n"; - out << ind << "auto _this = dynamic_cast<" << ns_prefix << _class->name << "*> (data);\n"; + out << ind << "auto _this = reinterpret_cast<" << ns_prefix << _class->name << "*> (data);\n"; out << "\n"; out << ind << "if (_this == nullptr) {\n"; out << ind << ind << "return SQ_ERROR;\n";