mirror of
https://github.com/pantor/inja.git
synced 2026-03-07 09:41:23 +00:00
If exceptions are disabled via `-fno-exceptions` or `INJA_NOEXCEPTION`, the use of try-catch is disallowed by the compiler. This patch makes does two things: * Gates the use of try-catch in one translation unit on the definition of `INJA_NOEXCEPTION`. * Make it such that translation units compiled with `-fno-exceptions` but no `INJA_NOEXCEPTION` implicitly sets `INJA_NOEXCEPTION`. In the specific case of `ifstream::open`, setting the exceptions bits without exceptions enabled should trip an assertion just like INJA_ABORT. The nice message will not be present however, but that is absent when using INJA_ABORT as well. After this patch, inja can be successfully included without issue.