Port better to POSIX hosts lacking _setjmp.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Sep 2012 07:06:56 +0000 (00:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Sep 2012 07:06:56 +0000 (00:06 -0700)
commit0328b6de4a92676b4ad4616095ce19a4f51d1c4d
treefba6da827e1383b3ff6ee4b738d2ac74a5956dde
parent823751606a90e3850551b43e707d58bbf58033dc
Port better to POSIX hosts lacking _setjmp.

* configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
(_setjmp, _longjmp): Remove.
* src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
All instances of '#include <setjmp.h>' removed, if the
only reason for the instance was because "lisp.h" was included.
(sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
and _longjmp with the new symbols.  Emacs already uses _setjmp if
available, so this change affects only POSIXish hosts that have
sigsetjmp but not _setjmp, such as some versions of Solaris and
Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
* src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
(png_load_body) [HAVE_PNG]:
(PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
(PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
since PNG requires jmp_buf.  This is the only exception to the
general rule that we now use sys_setjmp and sys_longjmp.
This exception is OK since this code does not change the signal
mask or longjmp out of a signal handler.

Fixes: debbugs:12446
100 files changed:
ChangeLog
configure.ac
src/ChangeLog
src/alloc.c
src/atimer.c
src/bidi.c
src/buffer.c
src/bytecode.c
src/callint.c
src/callproc.c
src/casefiddle.c
src/casetab.c
src/category.c
src/ccl.c
src/character.c
src/charset.c
src/chartab.c
src/cm.c
src/cmds.c
src/coding.c
src/composite.c
src/data.c
src/dbusbind.c
src/dired.c
src/dispnew.c
src/doc.c
src/doprnt.c
src/dosfns.c
src/editfns.c
src/emacs.c
src/emacsgtkfixed.c
src/eval.c
src/fileio.c
src/filelock.c
src/floatfns.c
src/fns.c
src/font.c
src/fontset.c
src/frame.c
src/fringe.c
src/ftfont.c
src/ftxfont.c
src/gnutls.c
src/gtkutil.c
src/image.c
src/indent.c
src/insdel.c
src/intervals.c
src/keyboard.c
src/keymap.c
src/lisp.h
src/lread.c
src/macros.c
src/marker.c
src/menu.c
src/minibuf.c
src/nsfns.m
src/nsfont.m
src/nsimage.m
src/nsmenu.m
src/nsselect.m
src/nsterm.m
src/print.c
src/process.c
src/ralloc.c
src/regex.c
src/region-cache.c
src/scroll.c
src/search.c
src/sheap.c
src/sound.c
src/syntax.c
src/sysdep.c
src/term.c
src/termcap.c
src/terminal.c
src/terminfo.c
src/textprop.c
src/tparam.c
src/undo.c
src/unexaix.c
src/unexcoff.c
src/unexcw.c
src/unexsol.c
src/vm-limit.c
src/widget.c
src/window.c
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xfont.c
src/xftfont.c
src/xgselect.c
src/xmenu.c
src/xml.c
src/xrdb.c
src/xselect.c
src/xsettings.c
src/xsmfns.c
src/xterm.c