[Bug 3707] New: simple implementation of assert() in bg_lib.h for QVMs

bugzilla-daemon at icculus.org bugzilla-daemon at icculus.org
Tue Jul 1 14:35:55 EDT 2008


http://bugzilla.icculus.org/show_bug.cgi?id=3707

           Summary: simple implementation of assert() in bg_lib.h for QVMs
           Product: Quake 3
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: Misc
        AssignedTo: zakk at icculus.org
        ReportedBy: bugzilla at benmachine.co.uk
         QAContact: quake3-bugzilla at icculus.org


QVM compilation doesn't have access to <assert.h>, so you can't call assert()
from any gamecode. This short patch adds assert() to bg_lib.h, which prints a
message something like:

********************
ERROR: src/game/g_main.c:529: Assertion `g_entities[ 63 ].client' failed.
********************
----- Server Shutdown (Server crashed: src/game/g_main.c:529: Assertion
`g_entities[ 63 ].client' failed.) -----
==== ShutdownGame ====

by calling:

Com_Error( ERR_DROP, __FILE__ ":" str(__LINE__) ": Assertion `" #x "' failed"
);

I'm not really sure if this is appropriate to ioq3 given that baseq3 and most
mods have their own VMs, but I thought it might be useful nonetheless.


-- 
Configure bugmail: http://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.



More information about the quake3-bugzilla mailing list