Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions examples/WindowsDemo/LuaHostWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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");
Expand All @@ -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");
Expand All @@ -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];
Expand Down Expand Up @@ -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 *) )
Expand Down
4 changes: 2 additions & 2 deletions examples/WindowsDemo/LuaHostWindows.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions source/tilde/HostConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,11 @@ namespace tilde
printf(s_printBuffer);
#endif // defined(WIN32)
}

void OsSleep(unsigned int millisecs)
{
#ifdef WIN32
Sleep(millisecs);
#endif
}
}