Skip to content

Commit

Permalink
Remove execinfo dependency and old crash_print handler (#84)
Browse files Browse the repository at this point in the history
* Use execinfo/backtrace lookup from YQ2

* Remove crash_print() and associated stuff
  • Loading branch information
erysdren authored Aug 26, 2024
1 parent 6d145a4 commit dbf4eed
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
43 changes: 0 additions & 43 deletions rott/dosutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,46 +162,3 @@ void DisplayTextSplash(byte *text, int l)

printf ("\033[m");
}

#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__HAIKU__) && !defined(_MSC_VER)
#include <execinfo.h>

void print_stack (int level)
{
void *array[64];
char **syms;
int size, i;

printf ("Stack dump:\n");
printf ("{\n");
size = backtrace (array, (sizeof (array))/(sizeof (array[0])));
syms = backtrace_symbols (array, size);
for (i=level+1; i<size;++i) {
printf ("\t%s\n",syms[i]);
}
free (syms);
/*
for (i = 2; i <size; ++i) {
printf ("\t%p\n", array[i]);
}
*/
printf ("}\n");
}
#else

void print_stack (int level)
{
printf("Stack dump not implemented.\n");
}

#endif

void crash_print (int sig)
{
printf ("OH NO OH NO ROTT CRASHED!\n");
printf ("Here is where:\n");
print_stack (1);
SDL_Quit ();
exit (1);
}

4 changes: 0 additions & 4 deletions rott/rt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ void Init_Tables (void);
void CheckRemoteRidicule ( int scancode );
void SetRottScreenRes (int Width, int Height);

extern void crash_print (int);

//extern int G_argc;
//extern char G_argv[30][80];
int G_weaponscale;
Expand All @@ -155,8 +153,6 @@ int main (int argc, char *argv[])
_argc = argc;
_argv = argv;

signal (11, crash_print);

ApogeePath = GetPrefDir();

// Set which release version we're on
Expand Down

0 comments on commit dbf4eed

Please sign in to comment.