another try
[supertux.git] / tools / miniswig / create_wrapper.cpp
index 1c63bc5..53e5b28 100644 (file)
@@ -259,7 +259,7 @@ WrapperCreator::create_function_wrapper(Class* _class, Function* function)
     if(function->type == Function::CONSTRUCTOR)
         function->name = "constructor";
 
-    out << "static int ";
+    out << "static SQInteger ";
     if(_class != 0) {
         out << _class->name << "_";
     }
@@ -286,8 +286,8 @@ WrapperCreator::create_function_wrapper(Class* _class, Function* function)
         if(function->type != Function::FUNCTION)
             throw std::runtime_error(
                     "custom not allow constructor+destructor yet");
-        if(function->return_type.atomic_type != &BasicType::INT)
-            throw std::runtime_error("custom function has to return int");
+        if(function->return_type.atomic_type != SQIntegerType::instance())
+            throw std::runtime_error("custom function has to return SQInteger");
         if(function->parameters.size() != 1)
             throw std::runtime_error(
                     "custom function must have 1 HSQUIRRELVM parameter");
@@ -520,7 +520,7 @@ WrapperCreator::create_squirrel_instance(Class* _class)
 void
 WrapperCreator::create_class_release_hook(Class* _class)
 {
-    out << "static int " << _class->name << "_release_hook(SQUserPointer ptr, int )\n"
+    out << "static SQInteger " << _class->name << "_release_hook(SQUserPointer ptr, int )\n"
         << "{\n"
         << ind << ns_prefix << _class->name 
         << "* _this = reinterpret_cast<" << ns_prefix << _class->name