initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#include "libNPK_StdAfx.h"
|
||||
#include "libNPK_Errors.h"
|
||||
|
||||
|
||||
namespace NPK
|
||||
{
|
||||
|
||||
static ErrorCode g_LastError = NPK_ERR_SUCCESS;
|
||||
static char g_strLastErrorDesc[1024] = {0};
|
||||
|
||||
//设置错误
|
||||
void setLastError(ErrorCode err, const char* desc, ...)
|
||||
{
|
||||
g_LastError = err;
|
||||
|
||||
g_strLastErrorDesc[0] = 0;
|
||||
|
||||
va_list ptr;
|
||||
va_start(ptr, desc);
|
||||
_vsnprintf(g_strLastErrorDesc, 1024, desc, ptr);
|
||||
va_end(ptr);
|
||||
}
|
||||
|
||||
//得到上一个错误
|
||||
ErrorCode getLastErrorCode(void)
|
||||
{
|
||||
return g_LastError;
|
||||
}
|
||||
|
||||
const char* getLastErrorMessage(void)
|
||||
{
|
||||
return g_strLastErrorDesc;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user