mirror of
				https://github.com/VCMP-SqMod/SqMod.git
				synced 2025-11-04 00:07:19 +01:00 
			
		
		
		
	Manage to get a working hello world.
This commit is contained in:
		@@ -376,9 +376,13 @@ void Worker::Work()
 | 
				
			|||||||
        case Job::Type::Stop:
 | 
					        case Job::Type::Stop:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
        case Job::Type::Eval:
 | 
					        case Job::Type::Eval: {
 | 
				
			||||||
            sq_compilebuffer(m_VM, job->mPayload.data(), job->mPayload.size(), nullptr, SQFalse);
 | 
					            sq_compilebuffer(m_VM, job->mPayload.data(), job->mPayload.size(), _SC("eval"), SQTrue);
 | 
				
			||||||
        break;
 | 
					            SQInteger top = sq_gettop(m_VM);
 | 
				
			||||||
 | 
					            sq_pushroottable(m_VM);
 | 
				
			||||||
 | 
					            sq_call(m_VM, 1, false, true);
 | 
				
			||||||
 | 
					            sq_settop(m_VM, top);
 | 
				
			||||||
 | 
					        } break;
 | 
				
			||||||
        case Job::Type::Exec:
 | 
					        case Job::Type::Exec:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
@@ -396,6 +400,7 @@ void Worker::PrintFunc(HSQUIRRELVM /*vm*/, CSStr msg, ...)
 | 
				
			|||||||
    va_start(args, msg);
 | 
					    va_start(args, msg);
 | 
				
			||||||
    // Forward the message to the logger
 | 
					    // Forward the message to the logger
 | 
				
			||||||
    std::vprintf(msg, args);
 | 
					    std::vprintf(msg, args);
 | 
				
			||||||
 | 
					    std::puts("");
 | 
				
			||||||
    // Finalize the variable argument list
 | 
					    // Finalize the variable argument list
 | 
				
			||||||
    va_end(args);
 | 
					    va_end(args);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -408,6 +413,7 @@ void Worker::ErrorFunc(HSQUIRRELVM /*vm*/, CSStr msg, ...)
 | 
				
			|||||||
    va_start(args, msg);
 | 
					    va_start(args, msg);
 | 
				
			||||||
    // Tell the logger to display debugging information
 | 
					    // Tell the logger to display debugging information
 | 
				
			||||||
    std::vprintf(msg, args);
 | 
					    std::vprintf(msg, args);
 | 
				
			||||||
 | 
					    std::puts("");
 | 
				
			||||||
    // Finalize the variable argument list
 | 
					    // Finalize the variable argument list
 | 
				
			||||||
    va_end(args);
 | 
					    va_end(args);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -448,6 +448,8 @@ struct Worker
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        // Create the job
 | 
					        // Create the job
 | 
				
			||||||
        std::unique_ptr< Job > job(new Job(std::move(callback)));
 | 
					        std::unique_ptr< Job > job(new Job(std::move(callback)));
 | 
				
			||||||
 | 
					        // Define type
 | 
				
			||||||
 | 
					        job->mType = Job::Type::Eval;
 | 
				
			||||||
        // Assign data
 | 
					        // Assign data
 | 
				
			||||||
        job->mPayload.assign(str.mPtr, static_cast< size_t >(str.mLen));
 | 
					        job->mPayload.assign(str.mPtr, static_cast< size_t >(str.mLen));
 | 
				
			||||||
        // Submit job
 | 
					        // Submit job
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user