mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(error): implement SErrSetLastError and SErrGetLastError functions
This commit is contained in:
parent
095b042583
commit
630e6dbb1f
2 changed files with 19 additions and 2 deletions
|
|
@ -3,6 +3,12 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
static uint32_t s_lasterror = ERROR_SUCCESS;
|
||||
|
||||
[[noreturn]] void SErrDisplayAppFatal(const char* format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
|
@ -70,5 +76,13 @@ void SErrPrepareAppFatal(const char* filename, int32_t linenumber) {
|
|||
}
|
||||
|
||||
void SErrSetLastError(uint32_t errorcode) {
|
||||
// TODO
|
||||
s_lasterror = errorcode;
|
||||
|
||||
#if defined(WHOA_SYSTEM_WIN)
|
||||
SetLastError(errorcode);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t SErrGetLastError() {
|
||||
return s_lasterror;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue