
On 12/7/2010 12:47 AM, Emil Dotchevski wrote:
On 12/6/2010 11:45 PM, Emil Dotchevski wrote:
Did you use -fexceptions with GCC, and if I'm not mistaken MSVC also has an option to assume that C functions don't throw exceptions, which shouldn't be used for exceptions to work.
I suspect that -fexceptions was not in play but it's conceivable that our build system adds it automatically when compiling C. I'll double check when I'm at work tomorrow.
If I'm not mistaken, the default for GCC is to assume C functions can't emit exceptions, -fexceptions tells it that they could. A few C libs seem to be compatible with this setup, for example with libpng I register an error callback function which throws, and it works fine but only if -fexceptions is used.
Ah I see. Well, my libraries are configurable at build time to allow that. In the JPEG case for example, defining either JPEGXX_C_LIB_COMPILED_AS_CPLUSPLUS or JPEGXX_CAN_THROW_EXCEPTIONS_THROUGH_C_LIB will allow exceptions to propagate undisturbed. Would it be appropriate to do something similar in the GIL I/O extension? FWIW, I'd like to see it. Kind regards, Edd