Compilation fix

This commit is contained in:
Nekotekina 2014-08-22 18:58:50 +04:00
parent 7a466b7fb7
commit 52cf911c60
6 changed files with 39 additions and 19 deletions

View File

@ -150,8 +150,7 @@ public:
{ {
if (!Emu.IsStopped()) if (!Emu.IsStopped())
{ {
LOG_ERROR(HLE, "SMutexLockerBase: thread id == 0"); assert(!"SMutexLockerBase: thread id == 0");
Emu.Pause();
} }
return; return;
} }

View File

@ -1,5 +1,6 @@
#pragma once #pragma once
#include <unordered_map> #include <unordered_map>
#include <set>
#define rID_ANY -1 // was wxID_ANY #define rID_ANY -1 // was wxID_ANY

View File

@ -0,0 +1,18 @@
#include "stdafx.h"
#include "Utilities/Log.h"
#include "LogBase.h"
void LogBase::LogNotice(const std::string& text)
{
LOG_NOTICE(HLE, "%s", text.c_str());
}
void LogBase::LogWarning(const std::string& text)
{
LOG_WARNING(HLE, "%s", text.c_str());
}
void LogBase::LogError(const std::string& text)
{
LOG_ERROR(HLE, "%s", text.c_str());
}

View File

@ -4,18 +4,16 @@ class LogBase
{ {
bool m_logging; bool m_logging;
void LogNotice(const std::string& text);
void LogWarning(const std::string& text);
void LogError(const std::string& text);
public: public:
void SetLogging(bool value) void SetLogging(bool value)
{ {
m_logging = value; m_logging = value;
} }
bool GetLogging()
{
//return m_logging; // TODO
return Ini.HLELogging.GetValue();
}
LogBase() LogBase()
{ {
SetLogging(false); SetLogging(false);
@ -25,17 +23,17 @@ public:
template<typename... Targs> void Notice(const u32 id, const char* fmt, Targs... args) template<typename... Targs> void Notice(const u32 id, const char* fmt, Targs... args)
{ {
LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...)); LogNotice(GetName() + fmt::Format("[%d]: ", id) + fmt::Format(fmt, args...));
} }
template<typename... Targs> void Notice(const char* fmt, Targs... args) template<typename... Targs> void Notice(const char* fmt, Targs... args)
{ {
LOG_NOTICE(HLE, GetName() + ": " + fmt::Format(fmt, args...)); LogNotice(GetName() + ": " + fmt::Format(fmt, args...));
} }
template<typename... Targs> __forceinline void Log(const char* fmt, Targs... args) template<typename... Targs> __forceinline void Log(const char* fmt, Targs... args)
{ {
if (GetLogging()) if (m_logging)
{ {
Notice(fmt, args...); Notice(fmt, args...);
} }
@ -43,7 +41,7 @@ public:
template<typename... Targs> __forceinline void Log(const u32 id, const char* fmt, Targs... args) template<typename... Targs> __forceinline void Log(const u32 id, const char* fmt, Targs... args)
{ {
if (GetLogging()) if (m_logging)
{ {
Notice(id, fmt, args...); Notice(id, fmt, args...);
} }
@ -51,31 +49,31 @@ public:
template<typename... Targs> void Warning(const u32 id, const char* fmt, Targs... args) template<typename... Targs> void Warning(const u32 id, const char* fmt, Targs... args)
{ {
LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...)); LogWarning(GetName() + fmt::Format("[%d] warning: ", id) + fmt::Format(fmt, args...));
} }
template<typename... Targs> void Warning(const char* fmt, Targs... args) template<typename... Targs> void Warning(const char* fmt, Targs... args)
{ {
LOG_WARNING(HLE, GetName() + " warning: " + fmt::Format(fmt, args...)); LogWarning(GetName() + " warning: " + fmt::Format(fmt, args...));
} }
template<typename... Targs> void Error(const u32 id, const char* fmt, Targs... args) template<typename... Targs> void Error(const u32 id, const char* fmt, Targs... args)
{ {
LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...)); LogError(GetName() + fmt::Format("[%d] error: ", id) + fmt::Format(fmt, args...));
} }
template<typename... Targs> void Error(const char* fmt, Targs... args) template<typename... Targs> void Error(const char* fmt, Targs... args)
{ {
LOG_ERROR(HLE, GetName() + " error: " + fmt::Format(fmt, args...)); LogError(GetName() + " error: " + fmt::Format(fmt, args...));
} }
template<typename... Targs> void Todo(const u32 id, const char* fmt, Targs... args) template<typename... Targs> void Todo(const u32 id, const char* fmt, Targs... args)
{ {
LOG_ERROR(HLE, GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...)); LogError(GetName() + fmt::Format("[%d] TODO: ", id) + fmt::Format(fmt, args...));
} }
template<typename... Targs> void Todo(const char* fmt, Targs... args) template<typename... Targs> void Todo(const char* fmt, Targs... args)
{ {
LOG_ERROR(HLE, GetName() + " TODO: " + fmt::Format(fmt, args...)); LogError(GetName() + " TODO: " + fmt::Format(fmt, args...));
} }
}; };

View File

@ -93,6 +93,7 @@
<ClCompile Include="Emu\RSX\RSXThread.cpp" /> <ClCompile Include="Emu\RSX\RSXThread.cpp" />
<ClCompile Include="Emu\SysCalls\Callback.cpp" /> <ClCompile Include="Emu\SysCalls\Callback.cpp" />
<ClCompile Include="Emu\SysCalls\FuncList.cpp" /> <ClCompile Include="Emu\SysCalls\FuncList.cpp" />
<ClCompile Include="Emu\SysCalls\LogBase.cpp" />
<ClCompile Include="Emu\SysCalls\lv2\lv2Fs.cpp" /> <ClCompile Include="Emu\SysCalls\lv2\lv2Fs.cpp" />
<ClCompile Include="Emu\SysCalls\lv2\sys_cond.cpp" /> <ClCompile Include="Emu\SysCalls\lv2\sys_cond.cpp" />
<ClCompile Include="Emu\SysCalls\lv2\sys_event.cpp" /> <ClCompile Include="Emu\SysCalls\lv2\sys_event.cpp" />

View File

@ -605,6 +605,9 @@
<ClCompile Include="..\Utilities\AutoPause.cpp"> <ClCompile Include="..\Utilities\AutoPause.cpp">
<Filter>Utilities</Filter> <Filter>Utilities</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Emu\SysCalls\LogBase.cpp">
<Filter>Emu\SysCalls</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Crypto\aes.h"> <ClInclude Include="Crypto\aes.h">
@ -1155,7 +1158,7 @@
</ClInclude> </ClInclude>
<ClInclude Include="Emu\SysCalls\Modules\cellL10n.h"> <ClInclude Include="Emu\SysCalls\Modules\cellL10n.h">
<Filter>Emu\SysCalls\Modules</Filter> <Filter>Emu\SysCalls\Modules</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Emu\IdManager.h"> <ClInclude Include="Emu\IdManager.h">
<Filter>Emu</Filter> <Filter>Emu</Filter>
</ClInclude> </ClInclude>