Don't write to client.log for webclient

Also work on getting client to compile for powerpc on linux
This commit is contained in:
UnknownShadow200 2019-07-04 08:08:04 +10:00
parent efdbeaed6c
commit 7b63884820

View File

@ -442,9 +442,13 @@ static void Logger_DumpBacktrace(String* str, void* ctx) {
static void Logger_DumpRegisters(void* ctx) { static void Logger_DumpRegisters(void* ctx) {
String str; char strBuffer[512]; String str; char strBuffer[512];
#ifdef CC_BUILD_OPENBSD #if defined CC_BUILD_OPENBSD
struct sigcontext r; struct sigcontext r;
r = *((ucontext_t*)ctx); r = *((ucontext_t*)ctx);
#elif defined CC_BUILD_LINUX && __PPC__ && __WORDSIZE == 32
/* see sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h in glibc */
mcontext_t r;
r = *((ucontext_t*)ctx)->uc_mcontext.uc_regs;
#else #else
mcontext_t r; mcontext_t r;
r = ((ucontext_t*)ctx)->uc_mcontext; r = ((ucontext_t*)ctx)->uc_mcontext;
@ -489,10 +493,12 @@ static void Logger_DumpRegisters(void* ctx) {
#define REG_GET(ign, reg) &r.__gregs[_REG_R##reg] #define REG_GET(ign, reg) &r.__gregs[_REG_R##reg]
#endif #endif
Logger_Dump_X64() Logger_Dump_X64()
#elif defined __ppc__ #elif defined __ppc__ || defined __PPC__
#if defined CC_BUILD_OSX #if defined CC_BUILD_OSX
#define REG_GNUM(num) &r->__ss.__r##num #define REG_GNUM(num) &r->__ss.__r##num
#define REG_GET(reg, ign) &r->__ss.__##reg #define REG_GET(reg, ign) &r->__ss.__##reg
#elif defined CC_BUILD_LINUX
#define REG_GNUM(num) &r.gregs[num]
#endif #endif
Logger_Dump_PPC() Logger_Dump_PPC()
#elif defined __aarch64__ #elif defined __aarch64__
@ -674,6 +680,7 @@ static struct Stream logStream;
static bool logOpen; static bool logOpen;
void Logger_Log(const String* msg) { void Logger_Log(const String* msg) {
#ifndef CC_BUILD_WEB
static const String path = String_FromConst("client.log"); static const String path = String_FromConst("client.log");
ReturnCode res; ReturnCode res;
@ -685,6 +692,7 @@ void Logger_Log(const String* msg) {
if (!logStream.Meta.File) return; if (!logStream.Meta.File) return;
Stream_Write(&logStream, (const uint8_t*)msg->buffer, msg->length); Stream_Write(&logStream, (const uint8_t*)msg->buffer, msg->length);
#endif
} }
static void Logger_LogCrashHeader(void) { static void Logger_LogCrashHeader(void) {