@@ -337,15 +337,21 @@ xr_vector<xr_string> xrDebug::BuildStackTrace(PCONTEXT threadCtx, u16 maxFramesC
337337
338338 return traceResult;
339339}
340+ #endif // defined(WINDOWS)
340341
341342SStringVec xrDebug::BuildStackTrace (u16 maxFramesCount)
342343{
344+ #if defined(WINDOWS)
343345 CONTEXT currentThreadCtx = {};
344346
345347 RtlCaptureContext (¤tThreadCtx); // / GetThreadContext can't be used on the current thread
346348 currentThreadCtx.ContextFlags = CONTEXT_FULL;
347349
348350 return BuildStackTrace (¤tThreadCtx, maxFramesCount);
351+ #else
352+ #pragma todo("Implement stack trace for Linux")
353+ return {" Implement stack trace for Linux" };
354+ #endif
349355}
350356
351357void xrDebug::LogStackTrace (const char * header)
@@ -357,7 +363,6 @@ void xrDebug::LogStackTrace(const char* header)
357363 Msg (" %s" , frame.c_str ());
358364 }
359365}
360- #endif // defined(WINDOWS)
361366
362367
363368void xrDebug::GatherInfo (char * assertionInfo, size_t bufferSize, const ErrorLocation& loc, const char * expr,
@@ -563,9 +568,9 @@ int out_of_memory_handler(size_t size)
563568
564569extern LPCSTR log_name ();
565570
566- #ifdef USE_BUG_TRAP
567- void WINAPI xrDebug::PreErrorHandler (INT_PTR)
571+ void xrDebug::PreErrorHandler (INT_PTR)
568572{
573+ #if defined(USE_BUG_TRAP) && defined(WINDOWS)
569574 if (!xr_FS || !FS.m_Flags .test (CLocatorAPI::flReady))
570575 return ;
571576 string_path logDir;
@@ -587,7 +592,6 @@ void WINAPI xrDebug::PreErrorHandler(INT_PTR)
587592 }
588593 string_path temp;
589594 strconcat (sizeof (temp), temp, logDir, log_name ());
590- #if defined(WINDOWS)
591595 BT_AddLogFile (temp);
592596 if (*BugReportFile)
593597 BT_AddLogFile (BugReportFile);
@@ -604,7 +608,7 @@ void WINAPI xrDebug::PreErrorHandler(INT_PTR)
604608
605609void xrDebug::SetupExceptionHandler (const bool & dedicated)
606610{
607- #if defined(WINDOWS)
611+ #if defined(USE_BUG_TRAP) && defined( WINDOWS)
608612 // disable 'appname has stopped working' popup dialog
609613 UINT prevMode = SetErrorMode (SEM_NOGPFAULTERRORBOX);
610614 SetErrorMode (prevMode | SEM_NOGPFAULTERRORBOX);
@@ -641,7 +645,6 @@ void xrDebug::SetupExceptionHandler(const bool& dedicated)
641645 BT_SetSupportEMail (
" [email protected] " );
642646#endif
643647}
644- #endif // USE_BUG_TRAP
645648
646649#ifdef USE_OWN_MINI_DUMP
647650void xrDebug::SaveMiniDump (EXCEPTION_POINTERS *exPtrs)
0 commit comments