Re: [AD] Exception Support for Allegro

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


Chris wrote:

Exceptions are C++, allegro is C, so I don't think it is a good
idea.

Why not? People use Allegro with C++, people use C++ callbacks, but
they can't throw exceptions from callbacks without the switch. As I
understand the manual, it doesn't sacrifice any speed so the only
things you get by not using it are a few saved bytes and users who
can't throw C++ exceptions from callbacks.

First, sorry, I did not quite understand the original post right at
first. I thought that's another 'let's rewrite allegro in C++' guy :)
So I take my words back, adding a compiler switch would not harm for
sure.

But as original poster mentioned dlls, beware of ABI problems anyway.
For example, using mingw built allegro dll with the program compiled
using mingw should be ok. On the other hand when you compile the program
using mingw, but use msvc compiled allegro dll, you get into the trouble
again and compilation switches will not help you (as different compilers
may use different and uncompatible stack unwinding). Allegro dll has C
interface and it is better to use it as C, throwing exception from a
callback will not be very safe, otherwise you will be strictly required
to use the same compiler for both the dynamic library and the program.






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