Re: [AD] 4.3 error handling

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Assuming it is true that setjmp/longjmp can trash the registers, how about 
taking the callback idea and having Allegro include a C++ callback that'll 
throw C++ exceptions if you init Allegro with something like 
AL_THROW_EXCEPTIONS? The default callback would be to abort (pedantic I know, 
but newbie-safe), or you could set a callback that'll throw C++ exceptions, 
or you could set it NULL which would cause the error to be ignored (and the 
offending function would return a failure value, if possible).

IIRC, the main issue with throwing real exceptions in a callback was some 
question as to how compatible this would be if GCC throws an exception 
through an MSVC DLL, and vice-versa. Anybody have any info on this?




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/