From 6d5b7850c41de5d0b1a7a681634f7fbad1119ab0 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Thu, 29 Mar 2007 09:45:11 +0000 Subject: [PATCH] Backport (from branches/2.0): - ChangeLog for 2.0.6 - Exception handler git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1293 4a71c877-e1ca-e34f-864e-861f7616d084 --- ChangeLog | 9 ++++++++- lib/framework/exceptionhandler.c | 17 +++++++++++------ lib/framework/frame.h | 2 +- src/main.c | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffc3a08c2..a892b7938 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,15 +21,22 @@ * Fix: Missing transport in Campaign 2 Mission 1 and Campaign 3 Mission 1 arrives again * Fix: Various crashes * Graphics: + * New: Skybox * New: Translucent selection-box from version 1.x restored + * Fix: Better fog * Fix: Wrongly displayed tileset in Campaign 2 Mission 1 and Campaign 3 Mission 1 properly fixed * Fix: Camera now properly displayed on radar * Fix: Gamma control support improved * Fix: Colors on Mac corrected * Sound: * Fix: No more invalid OpenAL errors + * Fix: Properly startup without sound + * Cutscenes (still text only): + * Change: Make texts more easily readable + * Change: Proceed faster so it does not look as if Warzone hangs + * Change: Exit by pressing left mouse button * Commandline options: - * Fix: --resolution works as expect now + * Fix: --resolution works as expected now * Build system: * New: Docs can now be installed in Autotools builds * New: You can now control the installation dir for the icon and .desktop file by passing --icondir and --applicationdir to configure diff --git a/lib/framework/exceptionhandler.c b/lib/framework/exceptionhandler.c index ad9da1647..a764aeda1 100644 --- a/lib/framework/exceptionhandler.c +++ b/lib/framework/exceptionhandler.c @@ -19,10 +19,12 @@ */ #include "frame.h" + #if defined(WZ_OS_WIN) # include "dbghelp.h" + /** * Exception handling on Windows. * Ask the user whether he wants to safe a Minidump and then dump it into the temp directory. @@ -86,8 +88,10 @@ static LONG WINAPI windowsExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo) return EXCEPTION_CONTINUE_SEARCH; } + #elif defined(WZ_OS_POSIX) + // C99 headers: # include # include @@ -119,8 +123,8 @@ static struct sigaction oldAction[NSIG]; static struct utsname sysInfo; static BOOL gdbIsAvailable = FALSE, sysInfoValid = FALSE; -static char programPID[MAX_PID_STRING] = {'\0'}, gdbPath[MAX_PATH] = {'\0'}, * programCommand = NULL; -static const char *gdmpPath; +static char programPID[MAX_PID_STRING] = {'\0'}, gdbPath[MAX_PATH] = {'\0'}; +static const char * gdmpPath, * programCommand; /** @@ -467,8 +471,8 @@ static void posixExceptionHandler(int signum, siginfo_t * siginfo, WZ_DECL_UNUSE pid = fork(); if (pid == (pid_t)0) { - char * gdbArgv[] = { gdbPath, programCommand, programPID, NULL }, - * gdbEnv[] = {NULL}; + const char * gdbArgv[] = { gdbPath, programCommand, programPID, NULL }, + * gdbEnv[] = {NULL}; close(gdbPipe[1]); // No output to pipe @@ -478,7 +482,7 @@ static void posixExceptionHandler(int signum, siginfo_t * siginfo, WZ_DECL_UNUSE write(dumpFile, "GDB extended backtrace:\n", strlen("GDB extended backtrace:\n")); - execve(gdbPath, gdbArgv, gdbEnv); + execve(gdbPath, (char**)gdbArgv, (char**)gdbEnv); } else if (pid > (pid_t)0) { @@ -519,6 +523,7 @@ static void posixExceptionHandler(int signum, siginfo_t * siginfo, WZ_DECL_UNUSE raise(signum); } + #endif // WZ_OS_* @@ -527,7 +532,7 @@ static void posixExceptionHandler(int signum, siginfo_t * siginfo, WZ_DECL_UNUSE * * \param programCommand_x Command used to launch this program. Only used for POSIX handler. */ -void setupExceptionHandler(char * programCommand_x) +void setupExceptionHandler(const char * programCommand_x) { #if defined(WZ_OS_WIN) SetUnhandledExceptionFilter(windowsExceptionHandler); diff --git a/lib/framework/frame.h b/lib/framework/frame.h index b8f61b91a..7adc092c1 100644 --- a/lib/framework/frame.h +++ b/lib/framework/frame.h @@ -200,6 +200,6 @@ static inline void endian_fract(FRACT *fract) { # define endian_fract(x) #endif -void setupExceptionHandler(char * programCommand); +void setupExceptionHandler(const char * programCommand); #endif diff --git a/src/main.c b/src/main.c index c3559384e..a298f0ef0 100644 --- a/src/main.c +++ b/src/main.c @@ -280,7 +280,7 @@ static void initialize_PhysicsFS(void) */ static void scanDataDirs( void ) { - char tmpstr[MAX_PATH], prefix[MAX_PATH] = { '\0' }; + char tmpstr[MAX_PATH] = {'\0'}, prefix[MAX_PATH] = {'\0'}; // Find out which PREFIX we are in... strcpy( tmpstr, PHYSFS_getBaseDir() );