[Mammoth] Move remaining classes to a shared folder.
This commit is contained in:
parent
c42fb858ba
commit
5f8d577948
39 changed files with 55 additions and 56 deletions
34
lib/mammoth/util/debug.cpp
Normal file
34
lib/mammoth/util/debug.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include "util/debug.h"
|
||||
|
||||
#include <glacier/status/error.h>
|
||||
#include <zcall.h>
|
||||
|
||||
void dbgln(const glcr::String& string) { (void)ZDebug(string.cstr()); }
|
||||
|
||||
void check(uint64_t code) {
|
||||
switch (code) {
|
||||
case glcr::OK:
|
||||
return;
|
||||
case glcr::UNIMPLEMENTED:
|
||||
dbgln("crash: UNIMPLEMENTED");
|
||||
break;
|
||||
case glcr::CAP_NOT_FOUND:
|
||||
dbgln("crash: missing capability");
|
||||
break;
|
||||
case glcr::CAP_WRONG_TYPE:
|
||||
dbgln("crash: capability of the wrong type");
|
||||
break;
|
||||
case glcr::CAP_PERMISSION_DENIED:
|
||||
dbgln("crash: capability permissions error");
|
||||
break;
|
||||
default:
|
||||
dbgln("Unhandled code");
|
||||
break;
|
||||
}
|
||||
(void)ZProcessExit(code);
|
||||
}
|
||||
|
||||
void crash(const char* str, uint64_t code) {
|
||||
dbgln(str);
|
||||
(void)ZProcessExit(code);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue