From 363b89ce91f1d2a0500effed0c5ebcda66be10d5 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 3 Oct 2004 10:15:15 +0000 Subject: [PATCH] Should now be able to cope with malloc errors better by disabling the compiler entirly if the problem occurs. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@291 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/comprout.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/engine/qclib/comprout.c b/engine/qclib/comprout.c index 7b528b40c..49a938d98 100644 --- a/engine/qclib/comprout.c +++ b/engine/qclib/comprout.c @@ -52,12 +52,14 @@ void PostCompile(void) asmfile = NULL; } } -void PreCompile(void) +pbool PreCompile(void) { qccClearHunk(); strcpy(qcc_gamedir, ""); qcchunk = malloc(qcchunksize=16*1024*1024); qccalloced=0; + + return !!qcchunk; } void QCC_main (int argc, char **argv); @@ -85,7 +87,8 @@ pbool CompileParams(progfuncs_t *progfuncs, int doall, int nump, char **parms) return false; } - PreCompile(); + if (!PreCompile()) + return false; QCC_main(nump, parms); while(qcc_compileactive) @@ -109,7 +112,8 @@ int Comp_Begin(progfuncs_t *progfuncs, int nump, char **parms) return false; } - PreCompile(); + if (!PreCompile()) + return false; QCC_main(nump, parms); return true;