aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lwlib/ChangeLog9
-rw-r--r--lwlib/lwlib-Xaw.c1
-rw-r--r--lwlib/lwlib-Xlw.c1
-rw-r--r--lwlib/lwlib-Xm.c1
-rw-r--r--lwlib/lwlib-utils.c1
-rw-r--r--lwlib/lwlib.c1
-rw-r--r--lwlib/xlwmenu.c1
-rw-r--r--src/ChangeLog103
-rw-r--r--src/alloc.c8
-rw-r--r--src/atimer.c1
-rw-r--r--src/buffer.c1
-rw-r--r--src/bytecode.c1
-rw-r--r--src/callint.c1
-rw-r--r--src/callproc.c1
-rw-r--r--src/casefiddle.c1
-rw-r--r--src/casetab.c1
-rw-r--r--src/category.c1
-rw-r--r--src/ccl.c1
-rw-r--r--src/character.c1
-rw-r--r--src/charset.c1
-rw-r--r--src/chartab.c1
-rw-r--r--src/cm.c1
-rw-r--r--src/cmds.c1
-rw-r--r--src/coding.c1
-rw-r--r--src/composite.c1
-rw-r--r--src/data.c1
-rw-r--r--src/dbusbind.c1
-rw-r--r--src/dired.c1
-rw-r--r--src/dispnew.c1
-rw-r--r--src/doc.c1
-rw-r--r--src/doprnt.c1
-rw-r--r--src/dosfns.c1
-rw-r--r--src/editfns.c1
-rw-r--r--src/emacs.c1
-rw-r--r--src/eval.c37
-rw-r--r--src/fileio.c1
-rw-r--r--src/filelock.c1
-rw-r--r--src/floatfns.c1
-rw-r--r--src/fns.c1
-rw-r--r--src/font.c1
-rw-r--r--src/fontset.c1
-rw-r--r--src/frame.c1
-rw-r--r--src/fringe.c1
-rw-r--r--src/ftfont.c1
-rw-r--r--src/ftxfont.c1
-rw-r--r--src/gtkutil.c1
-rw-r--r--src/image.c14
-rw-r--r--src/indent.c1
-rw-r--r--src/insdel.c1
-rw-r--r--src/intervals.c1
-rw-r--r--src/keyboard.c1
-rw-r--r--src/keymap.c1
-rw-r--r--src/lisp.h35
-rw-r--r--src/macros.c1
-rw-r--r--src/marker.c1
-rw-r--r--src/menu.c1
-rw-r--r--src/minibuf.c1
-rw-r--r--src/msdos.c1
-rw-r--r--src/print.c1
-rw-r--r--src/process.c2
-rw-r--r--src/ralloc.c1
-rw-r--r--src/regex.c1
-rw-r--r--src/region-cache.c1
-rw-r--r--src/scroll.c1
-rw-r--r--src/search.c1
-rw-r--r--src/sheap.c1
-rw-r--r--src/sound.c1
-rw-r--r--src/syntax.c1
-rw-r--r--src/term.c1
-rw-r--r--src/termcap.c1
-rw-r--r--src/terminal.c1
-rw-r--r--src/terminfo.c1
-rw-r--r--src/textprop.c1
-rw-r--r--src/tparam.c1
-rw-r--r--src/undo.c1
-rw-r--r--src/unexaix.c1
-rw-r--r--src/unexcw.c1
-rw-r--r--src/unexec.c1
-rw-r--r--src/unexsol.c1
-rw-r--r--src/vm-limit.c1
-rw-r--r--src/w16select.c1
-rw-r--r--src/w32.c1
-rw-r--r--src/w32console.c1
-rw-r--r--src/w32fns.c1
-rw-r--r--src/w32font.c1
-rw-r--r--src/w32heap.c1
-rw-r--r--src/w32inevt.c1
-rw-r--r--src/w32menu.c1
-rw-r--r--src/w32proc.c1
-rw-r--r--src/w32reg.c1
-rw-r--r--src/w32select.c1
-rw-r--r--src/w32term.c1
-rw-r--r--src/w32uniscribe.c1
-rw-r--r--src/w32xfns.c1
-rw-r--r--src/widget.c1
-rw-r--r--src/window.c1
-rw-r--r--src/xdisp.c1
-rw-r--r--src/xfaces.c1
-rw-r--r--src/xfns.c1
-rw-r--r--src/xfont.c1
-rw-r--r--src/xftfont.c1
-rw-r--r--src/xmenu.c1
-rw-r--r--src/xrdb.c1
-rw-r--r--src/xselect.c1
-rw-r--r--src/xsmfns.c1
-rw-r--r--src/xterm.c1
106 files changed, 258 insertions, 49 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index bd9902c876..27f14f5f1d 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-19 Dan Nicolaescu <[email protected]>
+
+ * xlwmenu.c:
+ * lwlib.c:
+ * lwlib-utils.c:
+ * lwlib-Xm.c:
+ * lwlib-Xlw.c:
+ * lwlib-Xaw.c: Include setjmp.h.
+
2009-06-21 Chong Yidong <[email protected]>
* Branch for 23.1.
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index 14d85db428..4923e58a9a 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -25,6 +25,7 @@ Boston, MA 02110-1301, USA. */
#endif
#include <stdio.h>
+#include <setjmp.h>
#include "../src/lisp.h"
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c
index 658899fa5d..5ed075cf87 100644
--- a/lwlib/lwlib-Xlw.c
+++ b/lwlib/lwlib-Xlw.c
@@ -24,6 +24,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#endif
+#include <setjmp.h>
#include "lisp.h"
#include "lwlib-Xlw.h"
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index 6fdd236a03..48faea36e6 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -26,6 +26,7 @@ Boston, MA 02110-1301, USA. */
#include <unistd.h>
#include <stdio.h>
+#include <setjmp.h>
#include <X11/StringDefs.h>
#include <X11/IntrinsicP.h>
diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c
index dbdaf3c1b9..1b9f04f962 100644
--- a/lwlib/lwlib-utils.c
+++ b/lwlib/lwlib-utils.c
@@ -31,6 +31,7 @@ Boston, MA 02110-1301, USA. */
#undef index
#undef rindex
+#include <setjmp.h>
#include "../src/lisp.h"
#include <X11/Xatom.h>
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 80619e5e35..c887d8bd84 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -24,6 +24,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#endif
+#include <setjmp.h>
#include "../src/lisp.h"
#include <sys/types.h>
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index db12eb43ec..8eb6c75253 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -26,6 +26,7 @@ Boston, MA 02110-1301, USA. */
#include <config.h>
#endif
+#include <setjmp.h>
#include "lisp.h"
#include <stdio.h>
diff --git a/src/ChangeLog b/src/ChangeLog
index 7d4c0a2fc9..51c01fbc19 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,106 @@
+2009-10-19 Dan Nicolaescu <[email protected]>
+
+ * alloc.c: Do not define struct catchtag.
+ * eval.c: Move struct catchtag definition ...
+ * lisp.h: ... here.
+
+ * image.c: Move png.h #include earlier to avoid warnings.
+
+ * xterm.c:
+ * xsmfns.c:
+ * xselect.c:
+ * xrdb.c:
+ * xmenu.c:
+ * xftfont.c:
+ * xfont.c:
+ * xfns.c:
+ * xfaces.c:
+ * xdisp.c:
+ * window.c:
+ * widget.c:
+ * w32xfns.c:
+ * w32uniscribe.c:
+ * w32term.c:
+ * w32select.c:
+ * w32reg.c:
+ * w32proc.c:
+ * w32menu.c:
+ * w32inevt.c:
+ * w32heap.c:
+ * w32font.c:
+ * w32fns.c:
+ * w32console.c:
+ * w32.c:
+ * w16select.c:
+ * vm-limit.c:
+ * unexsol.c:
+ * unexec.c:
+ * unexcw.c:
+ * unexaix.c:
+ * undo.c:
+ * tparam.c:
+ * textprop.c:
+ * terminfo.c:
+ * terminal.c:
+ * termcap.c:
+ * term.c:
+ * syntax.c:
+ * sound.c:
+ * sheap.c:
+ * search.c:
+ * scroll.c:
+ * region-cache.c:
+ * regex.c:
+ * ralloc.c:
+ * process.c:
+ * print.c:
+ * msdos.c:
+ * minibuf.c:
+ * menu.c:
+ * marker.c:
+ * macros.c:
+ * keymap.c:
+ * keyboard.c:
+ * intervals.c:
+ * insdel.c:
+ * indent.c:
+ * gtkutil.c:
+ * ftxfont.c:
+ * ftfont.c:
+ * fringe.c:
+ * frame.c:
+ * fontset.c:
+ * font.c:
+ * fns.c:
+ * floatfns.c:
+ * filelock.c:
+ * fileio.c:
+ * emacs.c:
+ * editfns.c:
+ * dosfns.c:
+ * doprnt.c:
+ * doc.c:
+ * dispnew.c:
+ * dired.c:
+ * dbusbind.c:
+ * data.c:
+ * composite.c:
+ * coding.c:
+ * cmds.c:
+ * cm.c:
+ * chartab.c:
+ * charset.c:
+ * character.c:
+ * ccl.c:
+ * category.c:
+ * casetab.c:
+ * casefiddle.c:
+ * callproc.c:
+ * callint.c:
+ * bytecode.c:
+ * buffer.c:
+ * atimer.c: Include setjmp.h. (Bug#4643)
+
2009-10-18 Stefan Monnier <[email protected]>
Remove leftover table unibyte_to_multibyte_table.
diff --git a/src/alloc.c b/src/alloc.c
index d11eff3d38..557621af79 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <limits.h> /* For CHAR_BIT. */
+#include <setjmp.h>
#ifdef STDC_HEADERS
#include <stddef.h> /* For offsetof, used by PSEUDOVECSIZE. */
@@ -4939,13 +4940,6 @@ staticpro (varaddress)
abort ();
}
-struct catchtag
-{
- Lisp_Object tag;
- Lisp_Object val;
- struct catchtag *next;
-};
-
/***********************************************************************
Protection from GC
diff --git a/src/atimer.c b/src/atimer.c
index 4fc593b6d7..308d4688d7 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#include <lisp.h>
#include <syssignal.h>
#include <systime.h>
diff --git a/src/buffer.c b/src/buffer.c
index d74a40ac4f..2fc7a8b3a7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/param.h>
#include <errno.h>
#include <stdio.h>
+#include <setjmp.h>
#ifndef USE_CRT_DLL
extern int errno;
diff --git a/src/bytecode.c b/src/bytecode.c
index 0335af8186..4a1e2da355 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -34,6 +34,7 @@ by Hallvard:
*/
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "character.h"
diff --git a/src/callint.c b/src/callint.c
index 074f9c0fc5..a9f8f23146 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
diff --git a/src/callproc.c b/src/callproc.c
index 14d1ac0b3d..b1918b9cd5 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <errno.h>
#include <stdio.h>
+#include <setjmp.h>
#ifndef USE_CRT_DLL
extern int errno;
diff --git a/src/casefiddle.c b/src/casefiddle.c
index f01faa0119..112198b322 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "character.h"
diff --git a/src/casetab.c b/src/casetab.c
index 95fca03584..5ae4ee2b5f 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "character.h"
diff --git a/src/category.c b/src/category.c
index 84af413120..babed58c7f 100644
--- a/src/category.c
+++ b/src/category.c
@@ -30,6 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <ctype.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "character.h"
diff --git a/src/ccl.c b/src/ccl.c
index f110291ac7..0360015804 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -27,6 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "character.h"
diff --git a/src/character.c b/src/character.c
index e2896444c2..bfe99766bc 100644
--- a/src/character.c
+++ b/src/character.c
@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef emacs
#include <sys/types.h>
+#include <setjmp.h>
#include "lisp.h"
#include "character.h"
#include "buffer.h"
diff --git a/src/charset.c b/src/charset.c
index 7ca9240d74..cfdf95565a 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -31,6 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <ctype.h>
#include <sys/types.h>
+#include <setjmp.h>
#include "lisp.h"
#include "character.h"
#include "charset.h"
diff --git a/src/chartab.c b/src/chartab.c
index 30f7e8bef2..79906c38fd 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "character.h"
#include "charset.h"
diff --git a/src/cm.c b/src/cm.c
index 563a488c43..4077073f9f 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "frame.h"
diff --git a/src/cmds.c b/src/cmds.c
index 19073dccf4..5b5c6de817 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
diff --git a/src/coding.c b/src/coding.c
index 405284f778..678bafaa9e 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -289,6 +289,7 @@ encode_coding_XXX (coding)
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
diff --git a/src/composite.c b/src/composite.c
index cd84f3932b..a654b5e808 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "character.h"
diff --git a/src/data.c b/src/data.c
index 96e29a6c28..6d469e161d 100644
--- a/src/data.c
+++ b/src/data.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "puresize.h"
#include "character.h"
diff --git a/src/dbusbind.c b/src/dbusbind.c
index f4a5c6887d..86ec866ac6 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <stdio.h>
#include <dbus/dbus.h>
+#include <setjmp.h>
#include "lisp.h"
#include "frame.h"
#include "termhooks.h"
diff --git a/src/dired.c b/src/dired.c
index 10d8782d02..67002d32eb 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <setjmp.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/src/dispnew.c b/src/dispnew.c
index e43a1a9869..ba50b00198 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
#include <ctype.h>
+#include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/src/doc.c b/src/doc.c
index 71308e6904..6a53e0d3f7 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/file.h> /* Must be after sys/types.h for USG*/
#include <ctype.h>
+#include <setjmp.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
diff --git a/src/doprnt.c b/src/doprnt.c
index 95d6b789c4..2d5b893dd2 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <ctype.h>
+#include <setjmp.h>
#ifdef STDC_HEADERS
#include <float.h>
diff --git a/src/dosfns.c b/src/dosfns.c
index 62594f1671..30daed3077 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <string.h>
#include <dos.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "termchar.h"
diff --git a/src/editfns.c b/src/editfns.c
index 859e396582..8dfea1f595 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <sys/types.h>
#include <stdio.h>
+#include <setjmp.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/src/emacs.c b/src/emacs.c
index 1afcd08fb6..2724aeefd4 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/file.h>
+#include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/src/eval.c b/src/eval.c
index 20988392e5..4611731a65 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -20,12 +20,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "blockinput.h"
#include "commands.h"
#include "keyboard.h"
#include "dispextern.h"
-#include <setjmp.h>
#if HAVE_X_WINDOWS
#include "xterm.h"
@@ -49,41 +49,6 @@ struct backtrace
struct backtrace *backtrace_list;
-/* This structure helps implement the `catch' and `throw' control
- structure. A struct catchtag contains all the information needed
- to restore the state of the interpreter after a non-local jump.
-
- Handlers for error conditions (represented by `struct handler'
- structures) just point to a catch tag to do the cleanup required
- for their jumps.
-
- catchtag structures are chained together in the C calling stack;
- the `next' member points to the next outer catchtag.
-
- A call like (throw TAG VAL) searches for a catchtag whose `tag'
- member is TAG, and then unbinds to it. The `val' member is used to
- hold VAL while the stack is unwound; `val' is returned as the value
- of the catch form.
-
- All the other members are concerned with restoring the interpreter
- state. */
-
-struct catchtag
-{
- Lisp_Object tag;
- Lisp_Object val;
- struct catchtag *next;
- struct gcpro *gcpro;
- jmp_buf jmp;
- struct backtrace *backlist;
- struct handler *handlerlist;
- int lisp_eval_depth;
- int pdlcount;
- int poll_suppress_count;
- int interrupt_input_blocked;
- struct byte_stack *byte_stack;
-};
-
struct catchtag *catchlist;
#ifdef DEBUG_GCPRO
diff --git a/src/fileio.c b/src/fileio.c
index cfe1f54382..b83ef6fe45 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/src/filelock.c b/src/filelock.c
index c845a804ae..bed0057dcb 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/stat.h>
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
diff --git a/src/floatfns.c b/src/floatfns.c
index 15077efae6..5aaf5f7bad 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -48,6 +48,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <signal.h>
+#include <setjmp.h>
#include "lisp.h"
#include "syssignal.h"
diff --git a/src/fns.c b/src/fns.c
index e1431251e2..be5d9a9b43 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#endif
#include <time.h>
+#include <setjmp.h>
/* Note on some machines this defines `vector' as a typedef,
so make sure we don't use that name in this file. */
diff --git a/src/font.c b/src/font.c
index 2e5db2d8f1..6e33b9bec5 100644
--- a/src/font.c
+++ b/src/font.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
diff --git a/src/fontset.c b/src/fontset.c
index 35e186b3c3..cba84dc245 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "blockinput.h"
diff --git a/src/frame.c b/src/frame.c
index 47e084eb89..a66d4dd57e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <ctype.h>
+#include <setjmp.h>
#include "lisp.h"
#include "character.h"
#ifdef HAVE_X_WINDOWS
diff --git a/src/fringe.c b/src/fringe.c
index 41fc24d115..df62bee0ed 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "frame.h"
diff --git a/src/ftfont.c b/src/ftfont.c
index 367b796a21..ed9cb6f19d 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
diff --git a/src/ftxfont.c b/src/ftxfont.c
index 2cf45bb27a..1f97a94e94 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include <X11/Xlib.h>
#include "lisp.h"
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 9da2c7e9cb..8aa877a8f8 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <string.h>
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "xterm.h"
#include "blockinput.h"
diff --git a/src/image.c b/src/image.c
index fa4eecd040..d35bd83e6a 100644
--- a/src/image.c
+++ b/src/image.c
@@ -27,6 +27,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#endif
+#ifdef HAVE_PNG
+#if defined HAVE_LIBPNG_PNG_H
+# include <libpng/png.h>
+#else
+# include <png.h>
+#endif
+#endif
+
/* This makes the fields of a Display accessible, in Xlib header files. */
#define XLIB_ILLEGAL_ACCESS
@@ -5787,12 +5795,6 @@ png_image_p (object)
#ifdef HAVE_PNG
-#if defined HAVE_LIBPNG_PNG_H
-# include <libpng/png.h>
-#else
-# include <png.h>
-#endif
-
#ifdef HAVE_NTGUI
/* PNG library details. */
diff --git a/src/indent.c b/src/indent.c
index f10b235427..5a73fa1b21 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
diff --git a/src/insdel.c b/src/insdel.c
index b09bed66d5..2790116484 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
diff --git a/src/intervals.c b/src/intervals.c
index ee18dd5b4b..bb6023337f 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -39,6 +39,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
diff --git a/src/keyboard.c b/src/keyboard.c
index 396f22fa7a..de4e1c5647 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "termchar.h"
#include "termopts.h"
diff --git a/src/keymap.c b/src/keymap.c
index e4f68d386d..d050191dc4 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#if HAVE_ALLOCA_H
# include <alloca.h>
#endif
diff --git a/src/lisp.h b/src/lisp.h
index 6751898e16..4685578a41 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1826,6 +1826,41 @@ struct handler
extern struct handler *handlerlist;
+/* This structure helps implement the `catch' and `throw' control
+ structure. A struct catchtag contains all the information needed
+ to restore the state of the interpreter after a non-local jump.
+
+ Handlers for error conditions (represented by `struct handler'
+ structures) just point to a catch tag to do the cleanup required
+ for their jumps.
+
+ catchtag structures are chained together in the C calling stack;
+ the `next' member points to the next outer catchtag.
+
+ A call like (throw TAG VAL) searches for a catchtag whose `tag'
+ member is TAG, and then unbinds to it. The `val' member is used to
+ hold VAL while the stack is unwound; `val' is returned as the value
+ of the catch form.
+
+ All the other members are concerned with restoring the interpreter
+ state. */
+
+struct catchtag
+{
+ Lisp_Object tag;
+ Lisp_Object val;
+ struct catchtag *next;
+ struct gcpro *gcpro;
+ jmp_buf jmp;
+ struct backtrace *backlist;
+ struct handler *handlerlist;
+ int lisp_eval_depth;
+ int pdlcount;
+ int poll_suppress_count;
+ int interrupt_input_blocked;
+ struct byte_stack *byte_stack;
+};
+
extern struct catchtag *catchlist;
extern struct backtrace *backtrace_list;
diff --git a/src/macros.c b/src/macros.c
index c6ae0defa6..0d69b9203c 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "macros.h"
#include "commands.h"
diff --git a/src/marker.c b/src/marker.c
index dbaaf872c2..fd2b8b9108 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "character.h"
diff --git a/src/menu.c b/src/menu.c
index 5331cbc314..74d455a8c0 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "keyboard.h"
diff --git a/src/minibuf.c b/src/minibuf.c
index 138581fb83..fc876370a2 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "commands.h"
diff --git a/src/msdos.c b/src/msdos.c
index 9783e8ce16..b6820b50f2 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#ifdef MSDOS
+#include <setjmp.h>
#include "lisp.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/print.c b/src/print.c
index 5eee386cab..f90ec27a0a 100644
--- a/src/print.c
+++ b/src/print.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "character.h"
diff --git a/src/process.c b/src/process.c
index 99f57d35d4..b405f1ef69 100644
--- a/src/process.c
+++ b/src/process.c
@@ -38,6 +38,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h> /* some typedefs are used in sys/file.h */
#include <sys/file.h>
#include <sys/stat.h>
+#include <setjmp.h>
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
@@ -7641,6 +7642,7 @@ The variable takes effect when `start-process' is called. */);
#include <sys/stat.h>
#include <stdlib.h>
#include <fcntl.h>
+#include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/src/ralloc.c b/src/ralloc.c
index f5ebb8449c..6faee2cac8 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef emacs
#include <config.h>
+#include <setjmp.h>
#include "lisp.h" /* Needed for VALBITS. */
#include "blockinput.h"
diff --git a/src/regex.c b/src/regex.c
index 0c9e137aca..ac7b7510a6 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -117,6 +117,7 @@
that make sense only in Emacs. */
#ifdef emacs
+# include <setjmp.h>
# include "lisp.h"
# include "buffer.h"
diff --git a/src/region-cache.c b/src/region-cache.c
index 1f1df5fc16..22caf6ebf0 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
diff --git a/src/scroll.c b/src/scroll.c
index 4d57a2a9b8..c7c2630403 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <string.h>
+#include <setjmp.h>
#include "lisp.h"
#include "termchar.h"
#include "dispextern.h"
diff --git a/src/search.c b/src/search.c
index e6ae4b660b..8bfe61d5f6 100644
--- a/src/search.c
+++ b/src/search.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "syntax.h"
#include "category.h"
diff --git a/src/sheap.c b/src/sheap.c
index 96511e68f4..5e327764ef 100644
--- a/src/sheap.c
+++ b/src/sheap.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include <unistd.h>
diff --git a/src/sound.c b/src/sound.c
index 58a8a9c465..6f1f538597 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -44,6 +44,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
+#include <setjmp.h>
#include "lisp.h"
#include "dispextern.h"
#include "atimer.h"
diff --git a/src/syntax.c b/src/syntax.c
index 3c5a21de5c..048f0ee663 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <ctype.h>
+#include <setjmp.h>
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
diff --git a/src/term.c b/src/term.c
index 9e18df3160..d860a93235 100644
--- a/src/term.c
+++ b/src/term.c
@@ -37,6 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdarg.h>
+#include <setjmp.h>
#include "lisp.h"
#include "termchar.h"
diff --git a/src/termcap.c b/src/termcap.c
index 2ad31d7b96..46254c67c1 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -24,6 +24,7 @@ Boston, MA 02110-1301, USA. */
#ifdef emacs
+#include <setjmp.h>
#include <lisp.h> /* xmalloc is here */
/* Get the O_* definitions for open et al. */
#include <sys/file.h>
diff --git a/src/terminal.c b/src/terminal.c
index d9951dba46..c89f2e6000 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -18,6 +18,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "frame.h"
diff --git a/src/terminfo.c b/src/terminfo.c
index 9b6b76b9f7..03187c65e8 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
/* Define these variables that serve as global parameters to termcap,
diff --git a/src/textprop.c b/src/textprop.c
index 0018088b63..e82af12d90 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
diff --git a/src/tparam.c b/src/tparam.c
index dabf0ed971..dcf79a3b61 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -23,6 +23,7 @@ Boston, MA 02110-1301, USA. */
#endif
#ifdef emacs
+#include <setjmp.h>
#include "lisp.h" /* for xmalloc */
#else
diff --git a/src/undo.c b/src/undo.c
index 39ca983b76..f2a37cb408 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
#include "commands.h"
diff --git a/src/unexaix.c b/src/unexaix.c
index c224a3626f..5f61b5a03d 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -104,6 +104,7 @@ static int adjust_lnnoptrs (int, int, char *);
static int pagemask;
#ifdef emacs
+#include <setjmp.h>
#include "lisp.h"
static void
diff --git a/src/unexcw.c b/src/unexcw.c
index a7f4b6b2cf..1e65d65007 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <setjmp.h>
#include <lisp.h>
#include <stdio.h>
#include <fcntl.h>
diff --git a/src/unexec.c b/src/unexec.c
index a6852af7d0..c655583e30 100644
--- a/src/unexec.c
+++ b/src/unexec.c
@@ -204,6 +204,7 @@ static int pagemask;
#ifdef emacs
+#include <setjmp.h>
#include "lisp.h"
static
diff --git a/src/unexsol.c b/src/unexsol.c
index 9f919faedc..04e3f40799 100644
--- a/src/unexsol.c
+++ b/src/unexsol.c
@@ -3,6 +3,7 @@
#include <config.h>
#include <stdlib.h>
#include <dlfcn.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 5abf048913..06e99c638d 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -19,6 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef emacs
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#endif
diff --git a/src/w16select.c b/src/w16select.c
index 91ce8f13f1..4d2476030e 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <dpmi.h>
#include <go32.h>
#include <sys/farptr.h>
+#include <setjmp.h>
#include "lisp.h"
#include "dispextern.h" /* frame.h seems to want this */
#include "frame.h" /* Need this to get the X window of selected_frame */
diff --git a/src/w32.c b/src/w32.c
index e8b7abc082..786f8e2a84 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/utime.h>
#include <mbstring.h> /* for _mbspbrk */
#include <math.h>
+#include <setjmp.h>
/* must include CRT headers *before* config.h */
diff --git a/src/w32console.c b/src/w32console.c
index 947ff7554f..6b96c05b2e 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <windows.h>
#include <string.h>
+#include <setjmp.h>
#include "lisp.h"
#include "character.h"
diff --git a/src/w32fns.c b/src/w32fns.c
index 8003d79171..c06fa4ea9d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -27,6 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <limits.h>
#include <errno.h>
#include <math.h>
+#include <setjmp.h>
#include "lisp.h"
#include "w32term.h"
diff --git a/src/w32font.c b/src/w32font.c
index 995500aa0e..69462512ca 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <math.h>
#include <ctype.h>
#include <commdlg.h>
+#include <setjmp.h>
#include "lisp.h"
#include "w32term.h"
diff --git a/src/w32heap.c b/src/w32heap.c
index efdcdfa710..408917dda1 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -27,6 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <stdio.h>
+#include <setjmp.h>
#include "w32heap.h"
#include "lisp.h" /* for VALMASK */
diff --git a/src/w32inevt.c b/src/w32inevt.c
index ac7ca644c5..960e14de2a 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -30,6 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
+#include <setjmp.h>
#ifndef MOUSE_MOVED
#define MOUSE_MOVED 1
diff --git a/src/w32menu.c b/src/w32menu.c
index 677de1b180..c573e3713c 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
#include <mbstring.h>
+#include <setjmp.h>
#include "lisp.h"
#include "keyboard.h"
diff --git a/src/w32proc.c b/src/w32proc.c
index 40829f0d63..ab5c91f679 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <fcntl.h>
#include <signal.h>
#include <sys/file.h>
+#include <setjmp.h>
/* must include CRT headers *before* config.h */
diff --git a/src/w32reg.c b/src/w32reg.c
index 2b5b352c58..94f5196ea8 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Kevin Gallo */
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "w32term.h"
#include "blockinput.h"
diff --git a/src/w32select.c b/src/w32select.c
index ce93b54412..9c67fabcee 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -73,6 +73,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
*/
#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "w32term.h" /* for all of the w32 includes */
#include "w32heap.h" /* os_subtype */
diff --git a/src/w32term.c b/src/w32term.c
index b7642b4689..008042c810 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
+#include <setjmp.h>
#include "lisp.h"
#include "blockinput.h"
#include "w32term.h"
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 9e75b67161..2cb55d4c70 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -27,6 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define _WIN32_WINNT 0x500
#include <windows.h>
#include <usp10.h>
+#include <setjmp.h>
#include "lisp.h"
#include "w32term.h"
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 5bf39967e8..37ec500d55 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "keyboard.h"
#include "frame.h"
diff --git a/src/widget.c b/src/widget.c
index 91072c40ac..32b3649be5 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -31,6 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "xterm.h"
diff --git a/src/window.c b/src/window.c
index 9b50a85b0c..4630b6dd90 100644
--- a/src/window.c
+++ b/src/window.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "buffer.h"
diff --git a/src/xdisp.c b/src/xdisp.c
index a750a1b73b..f88750447a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -168,6 +168,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <limits.h>
+#include <setjmp.h>
#include "lisp.h"
#include "keyboard.h"
diff --git a/src/xfaces.c b/src/xfaces.c
index 4f808e41be..f120dfcbb5 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -204,6 +204,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h> /* This needs to be before termchar.h */
+#include <setjmp.h>
#include "lisp.h"
#include "character.h"
diff --git a/src/xfns.c b/src/xfns.c
index 87ff21b775..4fc08925eb 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <math.h>
+#include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/src/xfont.c b/src/xfont.c
index 7db7cae5c6..36ac09fcb1 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
+#include <setjmp.h>
#include <X11/Xlib.h>
#include "lisp.h"
diff --git a/src/xftfont.c b/src/xftfont.c
index 2b576c3d4a..e66b538fa1 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <setjmp.h>
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
diff --git a/src/xmenu.c b/src/xmenu.c
index c6d7b0d958..f899ddaa63 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -37,6 +37,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "keyboard.h"
diff --git a/src/xrdb.c b/src/xrdb.c
index fac97e4350..3ae7068e47 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -31,6 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <epaths.h>
#include <stdio.h>
+#include <setjmp.h>
#if 1 /* I'd really appreciate it if this code could go away... -JimB */
/* This avoids lossage in the `dual-universe' headers on AT&T SysV
diff --git a/src/xselect.c b/src/xselect.c
index 5cf4f74602..79e0c0a280 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h> /* termhooks.h needs this */
+#include <setjmp.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 80c4802a49..3e8220bd40 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/param.h>
#include <stdio.h>
+#include <setjmp.h>
#include "lisp.h"
#include "systime.h"
diff --git a/src/xterm.c b/src/xterm.c
index 72aea94e8b..c77136eb64 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
#include <stdio.h>
+#include <setjmp.h>
#ifdef HAVE_X_WINDOWS