Fixes for Windows.

This commit is contained in:
2021-10-23 15:15:08 +02:00
parent 1a29ae0c2a
commit 2fe2286df8
6 changed files with 20 additions and 15 deletions

View File

@@ -4,6 +4,8 @@
#include "angelscript_addons/scriptbuilder/scriptbuilder.h"
#include "angelscript_addons/scripthelper/scripthelper.h"
#include "angelscript_addons/scriptstdstring/scriptstdstring.h"
#include <chrono>
#include <thread>
static void print(const std::string& s) { std::cout << s << std::endl; }
@@ -22,7 +24,7 @@ int main() {
std::cout << "Waiting for debugger to attach." << std::endl;
while (!debugger.HasDebuggerAttached()) {
usleep(1000);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
std::cout << "Debugger attached." << std::endl;
@@ -84,7 +86,7 @@ class TestClass {
ctx->Execute();
while (ctx->GetState() != asEXECUTION_FINISHED && ctx->GetState() != asEXECUTION_EXCEPTION &&
ctx->GetState() != asEXECUTION_ABORTED && ctx->GetState() != asEXECUTION_ERROR) {
usleep(1000);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
ctx->Release();