[GRASS-dev] GRASS & QGIS: the future
Glynn Clements
glynn at gclements.plus.com
Thu May 29 15:38:07 PDT 2014
Radim Blazek wrote:
> > Can you try the attached patch? The new function should be used like:
> >
> > if (setjmp(*G_fatal_longjmp(1))) {
> > // this will be executed on fatal errors
> > }
>
> Works. Can I hope the patch will find a way to 7.0.0?
Committed in r60590.
The only aspect which might be invasive is that defs/gis.h now
includes <setjmp.h> for the jmp_buf declaration. Although this is a
standard C header, it's not necessarily as straightforward as other
headers, being tied to the compiler's internals. I would advise
checking whether there are any build issues on less-common platforms
(e.g. AIX) before promoting the change to release.
In the worst case, we can change the return type to void* and require
an explicit cast to jmp_buf* at the call site, meaning that <setjmp.h>
only needs to be included from lib/gis/error.c plus any file which
actually calls the function.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list