Minor X86UNIX Issues
by Gary "ChunkyKs" Briggs · in Torque Game Engine · 12/15/2006 (12:57 pm) · 2 replies
Just a few minor things:
1) engine/platformX86UNIX/x86UNIXFont.h, line 46
So then you need to edit x86UNIXFont.cc to make the second argument U32, also:
2) engine/platformX86UNIX/x86UNIXStrings.cc, lines 203,248, 253
These functions have the wrong return type:
3) engine/platformX86UNIX/x86UNIXProcessControl.cc, lines 120-139
Little presumptious here:
4) Final sniglet for the really cool kids: engine/platformX86UNIX/x86UNIXProcessControl.cc
include thus:
Gary (-;
EDIT: Missed another virtual declaration
1) engine/platformX86UNIX/x86UNIXFont.h, line 46
virtual bool create(const char *name, dsize_t size, U32 charset = TGE_ANSI_CHARSET);Shouldn't be virtual, and the second arg should be U32:
bool create(const char *name, U32 size, U32 charset = TGE_ANSI_CHARSET);
So then you need to edit x86UNIXFont.cc to make the second argument U32, also:
bool x86UNIXFont::create(const char *name, U32 size, U32 charset)
2) engine/platformX86UNIX/x86UNIXStrings.cc, lines 203,248, 253
These functions have the wrong return type:
U32 dStrlen(const char *str) U32 dStrspn(const char *str, const char *set) U32 dStrcspn(const char *str, const char *set)Should be:
dsize_t dStrlen(const char *str) dsize_t dStrspn(const char *str, const char *set) dsize_t dStrcspn(const char *str, const char *set)
3) engine/platformX86UNIX/x86UNIXProcessControl.cc, lines 120-139
Little presumptious here:
void ProcessControlInit()
{
// JMQ: ignore IO signals background read/write terminal (so that we don't
// get suspended in daemon mode)
signal(SIGTTIN, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
// we're not interested in the exit status of child processes, so this
// prevents zombies from accumulating.
#if defined(__FreeBSD__)
signal(SIGCHLD, SIG_IGN);
#else
signal(SIGCLD, SIG_IGN);
#endif
// install signal handler for SIGSEGV, so that we can attempt
// clean shutdown
signal(SIGSEGV, &SignalHandler);
signal(SIGTRAP, &SignalHandler);
}try:void ProcessControlInit()
{
// JMQ: ignore IO signals background read/write terminal (so that we don't
// get suspended in daemon mode)
signal(SIGTTIN, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
// we're not interested in the exit status of child processes, so this
// prevents zombies from accumulating.
#if defined(SIGCHLD) // CHUNKY CHANGED THIS BIT
signal(SIGCHLD, SIG_IGN);
#else
signal(SIGCLD, SIG_IGN);
#endif
// install signal handler for SIGSEGV, so that we can attempt
// clean shutdown
signal(SIGSEGV, &SignalHandler);
signal(SIGTRAP, &SignalHandler);
}4) Final sniglet for the really cool kids: engine/platformX86UNIX/x86UNIXProcessControl.cc
include thus:
#ifdef __GLIBC__ #include <execinfo.h> #endifAnd in the SignalHandler function, where it catches the SIGSEGV:
static void SignalHandler(int sigtype)
{
if (sigtype == SIGSEGV || sigtype == SIGTRAP)
{
signal(SIGSEGV, SIG_DFL);
signal(SIGTRAP, SIG_DFL);
#ifdef __GLIBC__
void *array[64]; int size, i;
char **syms;
fprintf(stderr, "Process %d Stack dump:\n\n", (int)getpid());
size = backtrace(array, (sizeof array)/(sizeof array[0]));
syms = backtrace_symbols(array, size);
for ( i=1; i<size; ++i ) {
fprintf(stderr, "\t%s\n", syms[i]);
}
free(syms);
fprintf(stderr, "\n");
#endif
// restore the signal handling to default so that we don't get into
// a crash loop with ImmediateShutdown
ImmediateShutdown(-sigtype, sigtype);
}
else
{
signal(sigtype, SIG_DFL);
dPrintf("Unknown signal caught by SignalHandler: %d\n", sigtype);
dFflushStdout();
// exit to be safe
ImmediateShutdown(1);
}
}Gary (-;
EDIT: Missed another virtual declaration
#2
In other news, I got it all to build, now it just won't link :-/
Gary (-;
12/15/2006 (3:55 pm)
EEEEEEEE, I'm a heroIn other news, I got it all to build, now it just won't link :-/
Gary (-;
Torque 3D Owner ArmedGeek