diff --git a/examples/WindowsDemo/LuaHostWindows.cpp b/examples/WindowsDemo/LuaHostWindows.cpp index 50a2564..ac2fae3 100644 --- a/examples/WindowsDemo/LuaHostWindows.cpp +++ b/examples/WindowsDemo/LuaHostWindows.cpp @@ -57,7 +57,7 @@ void print(const char * format, ...) vsnprintf(s_printBuffer, 1024, format, ap); va_end(ap); - OutputDebugStr(s_printBuffer); + OutputDebugString(s_printBuffer); printf(s_printBuffer); } @@ -71,7 +71,7 @@ void warn(const char * format, ...) vsnprintf(s_printBuffer, 1024, format, ap); va_end(ap); - OutputDebugStr(s_printBuffer); + OutputDebugString(s_printBuffer); printf(s_printBuffer); print("\n"); @@ -87,7 +87,7 @@ void error(const char * format, ...) vsnprintf(s_printBuffer, 1024, format, ap); va_end(ap); - OutputDebugStr(s_printBuffer); + OutputDebugString(s_printBuffer); printf(s_printBuffer); print("\n"); @@ -104,7 +104,7 @@ LuaHostWindows::LuaHostWindows(int port) m_debuggerSocket(SOCKET_ERROR) { m_machine = new LuaMachine(); - m_debuggerComms = new tilde::LuaDebuggerComms(m_machine->GetLVM(), this); + m_debuggerComms = new tilde::LuaDebuggerComms(this); m_netBufferSize = 4096; m_netBuffer = new tilde::u8[m_netBufferSize]; @@ -246,15 +246,15 @@ void LuaHostWindows::CloseDebuggerConnection() Close(); } -bool LuaHostWindows::AttachLuaHook( lua_Hook hook, int mask, int count ) +bool LuaHostWindows::AttachLuaHook(lua_State *L, lua_Hook hook, int mask, int count ) { - lua_sethook(m_debuggerComms->GetMainLVM(), hook, mask, count); + lua_sethook(L, hook, mask, count); return true; } -void LuaHostWindows::DetachLuaHook( lua_Hook hook ) +void LuaHostWindows::DetachLuaHook(lua_State *L, lua_Hook hook ) { - lua_sethook(m_debuggerComms->GetMainLVM(), NULL, 0, 0); + lua_sethook(L, NULL, 0, 0); } void LuaHostWindows::AttachPrintfHook( void (* hook)(const char *) ) diff --git a/examples/WindowsDemo/LuaHostWindows.h b/examples/WindowsDemo/LuaHostWindows.h index 371695c..56a5e5a 100644 --- a/examples/WindowsDemo/LuaHostWindows.h +++ b/examples/WindowsDemo/LuaHostWindows.h @@ -58,8 +58,8 @@ class LuaHostWindows : public tilde::LuaDebuggerHost virtual void SendDebuggerData(const void * data, int size); virtual void CloseDebuggerConnection(); - virtual bool AttachLuaHook(lua_Hook hook, int mask, int count); - virtual void DetachLuaHook(lua_Hook hook); + virtual bool AttachLuaHook(lua_State *L, lua_Hook hook, int mask, int count); + virtual void DetachLuaHook(lua_State *L, lua_Hook hook); virtual void AttachPrintfHook( void (* hook)(const char *) ); virtual void DetachPrintfHook( void (* hook)(const char *) ); virtual void ReceiveExCommand(const char * command, int datalen, tilde::ReceiveMessageBuffer * data); diff --git a/source/tilde/HostConfig.cpp b/source/tilde/HostConfig.cpp index 2bbfc2c..a9d164f 100644 --- a/source/tilde/HostConfig.cpp +++ b/source/tilde/HostConfig.cpp @@ -98,4 +98,11 @@ namespace tilde printf(s_printBuffer); #endif // defined(WIN32) } + + void OsSleep(unsigned int millisecs) + { +#ifdef WIN32 + Sleep(millisecs); +#endif + } }