From 8e8ef048606249d5a8bfceedc0c07dd9fffa7e55 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 30 Sep 2025 19:40:15 +0200 Subject: [PATCH] delet BUGTRAP psure this never worked anyways --- src/dedicated/i_main.c | 15 ++------ src/sdl/i_main.c | 5 --- src/win32/win_dbg.c | 78 ------------------------------------------ src/win32/win_dbg.h | 6 ---- 4 files changed, 3 insertions(+), 101 deletions(-) diff --git a/src/dedicated/i_main.c b/src/dedicated/i_main.c index 055b14882..93af6b14b 100644 --- a/src/dedicated/i_main.c +++ b/src/dedicated/i_main.c @@ -138,8 +138,7 @@ static void InitLogging(void) if (M_IsPathAbsolute(reldir)) { - left = snprintf(logfilename, sizeof logfilename, - "%s"PATHSEP, reldir); + left = snprintf(logfilename, sizeof logfilename, "%s"PATHSEP, reldir); } else #ifdef DEFAULTDIR @@ -155,13 +154,10 @@ static void InitLogging(void) "."PATHSEP"%s"PATHSEP, reldir); } - strftime(&logfilename[left], sizeof logfilename - left, - format, timeinfo); + strftime(&logfilename[left], sizeof logfilename - left, format, timeinfo); } - M_MkdirEachUntil(logfilename, - M_PathParts(logdir) - 1, - M_PathParts(logfilename) - 1, 0755); + M_MkdirEachUntil(logfilename, M_PathParts(logdir) - 1, M_PathParts(logfilename) - 1, 0755); #if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) logstream = fopen(logfilename, "w"); @@ -225,11 +221,6 @@ int main(int argc, char **argv) // never return D_SRB2Loop(); -#ifdef BUGTRAP - // This is safe even if BT didn't start. - ShutdownBugTrap(); -#endif - // return to OS return 0; } diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index 6955d0b4c..b2ab7777f 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -236,11 +236,6 @@ int main(int argc, char **argv) // never return D_SRB2Loop(); -#ifdef BUGTRAP - // This is safe even if BT didn't start. - ShutdownBugTrap(); -#endif - // return to OS return 0; } diff --git a/src/win32/win_dbg.c b/src/win32/win_dbg.c index 5576b1dc5..290227b09 100644 --- a/src/win32/win_dbg.c +++ b/src/win32/win_dbg.c @@ -45,84 +45,6 @@ BOOL InitDrMingw(void) } #endif -#ifdef BUGTRAP - -typedef void (APIENTRY *BT_SETSUPPORTURL)(LPCTSTR pszSupportURL); -typedef void (APIENTRY *BT_SETFLAGS)(DWORD dwFlags); -typedef void (APIENTRY *BT_SETAPPNAME)(LPCTSTR pszAppName); -typedef void (APIENTRY *BT_SETAPPVERSION)(LPCTSTR pszAppVersion); -typedef void (APIENTRY *BT_SETSUPPORTSERVER)(LPCTSTR pszSupportHost, SHORT nSupportPort); - -// BT constant definitions that we use, as given in the docs. -#define BTF_DETAILEDMODE 0x01 -#define BTF_ATTACHREPORT 0x04 - - -static HMODULE g_hmodBugTrap; - - -// -------------------------------------------------------------------------- -// Initialises the Bug Trap exception-handling library. Returns true iff -// successful. -// -------------------------------------------------------------------------- -BOOL InitBugTrap(void) -{ - BT_SETFLAGS lpfnBT_SetFlags; - BT_SETSUPPORTURL lpfnBT_SetSupportURL; - BT_SETAPPNAME lpfnBT_SetAppName; - BT_SETAPPVERSION lpfnBT_SetAppVersion; - BT_SETSUPPORTSERVER lpfnBT_SetSupportServer; - - // Loading the library installs the exception handler. -#ifdef UNICODE - g_hmodBugTrap = LoadLibrary(L"BugTrapU.dll"); -#else - g_hmodBugTrap = LoadLibrary("BugTrap.dll"); -#endif - - // Get the functions. - lpfnBT_SetFlags = (BT_SETFLAGS)GetProcAddress(g_hmodBugTrap, "BT_SetFlags"); - lpfnBT_SetSupportURL = (BT_SETSUPPORTURL)GetProcAddress(g_hmodBugTrap, "BT_SetSupportURL"); - lpfnBT_SetAppName = (BT_SETAPPNAME)GetProcAddress(g_hmodBugTrap, "BT_SetAppName"); - lpfnBT_SetAppVersion = (BT_SETAPPVERSION)GetProcAddress(g_hmodBugTrap, "BT_SetAppVersion"); - lpfnBT_SetSupportServer = (BT_SETSUPPORTSERVER)GetProcAddress(g_hmodBugTrap, "BT_SetSupportServer"); - - if (g_hmodBugTrap) - { - lpfnBT_SetAppName(TEXT("Sonic Robo Blast 2")); - lpfnBT_SetAppVersion(TEXT(VERSIONSTRING)); - lpfnBT_SetFlags(BTF_DETAILEDMODE | BTF_ATTACHREPORT); - lpfnBT_SetSupportURL(TEXT("http://www.srb2.org/")); - lpfnBT_SetSupportServer(TEXT("srb2.org"), 9999); - - return TRUE; - } - - return FALSE; -} - - -// -------------------------------------------------------------------------- -// Removes the BugTrap exception handler. Safe to call even if BT was never -// initialized. -// -------------------------------------------------------------------------- -void ShutdownBugTrap(void) -{ - if (g_hmodBugTrap) FreeLibrary(g_hmodBugTrap); -} - -// -------------------------------------------------------------------------- -// Simple test to check whether BugTrap is loaded without exposing its -// handle. -// -------------------------------------------------------------------------- -BOOL IsBugTrapLoaded(void) -{ - return !!g_hmodBugTrap; -} - -#endif // (defined BUGTRAP) - - #define NumCodeBytes 16 // Number of code bytes to record. #define MaxStackDump 2048 // Maximum number of DWORDS in stack dumps. #define StackColumns 8 // Number of columns in stack dump. diff --git a/src/win32/win_dbg.h b/src/win32/win_dbg.h index 1c696ae5c..414ffc2d9 100644 --- a/src/win32/win_dbg.h +++ b/src/win32/win_dbg.h @@ -24,12 +24,6 @@ BOOL InitDrMingw(void); #endif -#ifdef BUGTRAP -BOOL InitBugTrap(void); -void ShutdownBugTrap(void); -BOOL IsBugTrapLoaded(void); -#endif - // called in the exception filter of the __try block, writes all useful debugging information // to a file, using only win32 functions in case the C runtime is in a bad state. LONG WINAPI RecordExceptionInfo(PEXCEPTION_POINTERS data/*, LPCSTR Message, LPSTR lpCmdLine*/);