Make automatic prototype generation work with more interfaces.
diff --git a/src/Makefile b/src/Makefile
index 62c5835..db38f93 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -39,9 +39,10 @@
 #	- Uncomment one or more of these lines to include an interface;
 #	  each makes Vim quite a bit bigger:
 #		--enable-luainterp	for Lua interpreter
+#		--enable-mzschemeinterp	for MzScheme interpreter
 #		--enable-perlinterp	for Perl interpreter
-#		--enable-pythoninterp	for Python interpreter
 #		--enable-python3interp	for Python3 interpreter
+#		--enable-pythoninterp	for Python interpreter
 #		--enable-rubyinterp	for Ruby interpreter
 #		--enable-tclinterp	for Tcl interpreter
 #		--enable-cscope		for Cscope interface
@@ -368,6 +369,20 @@
 #CONF_OPT_DARWIN = --with-mac-arch=ppc
 #CONF_OPT_DARWIN = --with-mac-arch=both
 
+# LUA
+# Uncomment this when you want to include the Lua interface.
+#CONF_OPT_LUA = --enable-luainterp
+# Lua installation dir (when not set uses $LUA_PREFIX or defaults to /usr)
+#CONF_OPT_LUA_PREFIX = --with-lua-prefix=/usr/local
+
+# MZSCHEME
+# Uncomment this when you want to include the MzScheme interface.
+#CONF_OPT_MZSCHEME = --enable-mzschemeinterp
+# PLT/mrscheme/drscheme Home dir; the PLTHOME environment variable also works
+#CONF_OPT_PLTHOME  = --with-plthome=/usr/local/plt
+#CONF_OPT_PLTHOME  = --with-plthome=/usr/local/drscheme
+#CONF_OPT_PLTHOME  = --with-plthome=/home/me/mz
+
 # PERL
 # Uncomment this when you want to include the Perl interface.
 # The Perl option sometimes causes problems, because it adds extra flags
@@ -391,30 +406,16 @@
 #CONF_OPT_PYTHON = --enable-pythoninterp
 #CONF_OPT_PYTHON3 = --enable-python3interp
 
-# TCL
-# Uncomment this when you want to include the Tcl interface.
-#CONF_OPT_TCL = --enable-tclinterp
-#CONF_OPT_TCL = --enable-tclinterp --with-tclsh=tclsh8.4
-
 # RUBY
 # Uncomment this when you want to include the Ruby interface.
 # Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
 #CONF_OPT_RUBY = --enable-rubyinterp
 #CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
 
-# LUA
-# Uncomment this when you want to include the Lua interface.
-#CONF_OPT_LUA = --enable-luainterp
-# Lua installation dir (when not set uses $LUA_PREFIX or defaults to /usr)
-#CONF_OPT_LUA_PREFIX = --with-lua-prefix=/usr/local
-
-# MZSCHEME
-# Uncomment this when you want to include the MzScheme interface.
-#CONF_OPT_MZSCHEME = --enable-mzschemeinterp
-# PLT/mrscheme/drscheme Home dir; the PLTHOME environment variable also works
-#CONF_OPT_PLTHOME  = --with-plthome=/usr/local/plt
-#CONF_OPT_PLTHOME  = --with-plthome=/usr/local/drscheme
-#CONF_OPT_PLTHOME  = --with-plthome=/home/me/mz
+# TCL
+# Uncomment this when you want to include the Tcl interface.
+#CONF_OPT_TCL = --enable-tclinterp
+#CONF_OPT_TCL = --enable-tclinterp --with-tclsh=tclsh8.4
 
 # CSCOPE
 # Uncomment this when you want to include the Cscope interface.
@@ -545,7 +546,8 @@
 #CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes
 
 # Use this with GCC to check for mistakes, unused arguments, etc.
-#CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code -D_FORTIFY_SOURCE=1
+#CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code -D_FORTIFY_SOURCE=1 -DU_DEBUG
+#CFLAGS = -g -O2 -Wall -Wextra -Wmissing-prototypes -D_FORTIFY_SOURCE=1 -DU_DEBUG
 #PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
 #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter
 
@@ -1317,7 +1319,7 @@
 # with "-E".
 OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
 
-LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) -Dinline= -D__extension__= -Dalloca=alloca
+LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca
 
 LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
 
@@ -1714,10 +1716,11 @@
 
 # Filter out arguments that cproto doesn't support.
 # Don't pass "-pthread" to cproto, it sees it as a list of individual flags.
+# Don't pass "-fstack-protector" to cproto, for the same reason.
 # The -E"gcc -E" argument must be separate to avoid problems with shell
 # quoting.
 CPROTO = cproto $(PROTO_FLAGS) -DPROTO \
-	 `echo '$(LINT_CFLAGS)' | sed -e 's/-pthread//g'` 
+	 `echo '$(LINT_CFLAGS)' | sed -e 's/-pthread//g' -e 's/-fstack-protector//g'`
 
 ### Would be nice if this would work for "normal" make.
 ### Currently it only works for (Free)BSD make.
@@ -2997,10 +3000,10 @@
  auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
  regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
  globals.h farsi.h arabic.h
-objects/if_lua.o: if_lua.c vim.h auto/config.h feature.h os_unix.h \
- auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
- regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
- globals.h farsi.h arabic.h
+objects/if_lua.o: if_lua.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
+ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
+ gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
+ arabic.h
 objects/if_mzsch.o: if_mzsch.c vim.h auto/config.h feature.h os_unix.h \
  auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
  regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1dab501..c57db94 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8491,7 +8491,7 @@
 }
 
 #ifdef FEAT_PERSISTENT_UNDO
-    void
+    static void
 ex_wundo(eap)
     exarg_T *eap;
 {
@@ -8501,7 +8501,7 @@
     u_write_undo(eap->arg, eap->forceit, curbuf, hash);
 }
 
-    void
+    static void
 ex_rundo(eap)
     exarg_T *eap;
 {
diff --git a/src/if_python3.c b/src/if_python3.c
index 59ef88f..5400dc6 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -42,19 +42,21 @@
 # undef _DEBUG
 #endif
 
-#ifdef HAVE_STDARG_H
-# undef HAVE_STDARG_H   /* Python's config.h defines it as well. */
-#endif
-
 #define PY_SSIZE_T_CLEAN
 
 #ifdef F_BLANK
 # undef F_BLANK
 #endif
 
+#ifdef HAVE_STDARG_H
+# undef HAVE_STDARG_H   /* Python's config.h defines it as well. */
+#endif
 #ifdef _POSIX_C_SOURCE  /* defined in feature.h */
 # undef _POSIX_C_SOURCE
 #endif
+#ifdef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE	/* pyconfig.h defines it as well. */
+#endif
 
 #include <Python.h>
 #if defined(MACOS) && !defined(MACOS_X_UNIX)
@@ -436,7 +438,7 @@
 static void PythonIO_Flush(void);
 static int PythonIO_Init(void);
 static void PythonIO_Fini(void);
-PyMODINIT_FUNC Py3Init_vim(void);
+static PyMODINIT_FUNC Py3Init_vim(void);
 
 /* Utility functions for the vim/python interface
  * ----------------------------------------------
@@ -630,7 +632,7 @@
 }
 
 /*
- * ":python"
+ * ":python3"
  */
 void ex_python3(exarg_T *eap)
 {
@@ -650,7 +652,7 @@
 #define BUFFER_SIZE 2048
 
 /*
- * ":pyfile"
+ * ":py3file"
  */
     void
 ex_py3file(exarg_T *eap)
@@ -2220,7 +2222,7 @@
 
 static struct PyModuleDef vimmodule;
 
-PyMODINIT_FUNC Py3Init_vim(void)
+static PyMODINIT_FUNC Py3Init_vim(void)
 {
     PyObject *mod;
     /* The special value is removed from sys.path in Python3_Init(). */
diff --git a/src/proto/diff.pro b/src/proto/diff.pro
index f314fce..18c4265 100644
--- a/src/proto/diff.pro
+++ b/src/proto/diff.pro
@@ -22,6 +22,6 @@
 void ex_diffgetput __ARGS((exarg_T *eap));
 int diff_mode_buf __ARGS((buf_T *buf));
 int diff_move_to __ARGS((int dir, long count));
-linenr_T diff_get_corresponding_line __ARGS((buf_T *buf1, linenr_T lnum1, buf_T *buf2, linenr_T lnum2));
+linenr_T diff_get_corresponding_line __ARGS((buf_T *buf1, linenr_T lnum1, buf_T *buf2, linenr_T lnum3));
 linenr_T diff_lnum_win __ARGS((linenr_T lnum, win_T *wp));
 /* vim: set ft=c : */
diff --git a/src/proto/if_python3.pro b/src/proto/if_python3.pro
index cca0430..a2c7e4c 100644
--- a/src/proto/if_python3.pro
+++ b/src/proto/if_python3.pro
@@ -1,4 +1,4 @@
-/* if_python.c */
+/* if_python3.c */
 int python3_enabled __ARGS((int verbose));
 void python3_end __ARGS((void));
 void ex_python3 __ARGS((exarg_T *eap));
diff --git a/src/proto/main.pro b/src/proto/main.pro
index 2ecce79..62e80b8 100644
--- a/src/proto/main.pro
+++ b/src/proto/main.pro
@@ -6,7 +6,7 @@
 void mainerr_arg_missing __ARGS((char_u *str));
 void time_push __ARGS((void *tv_rel, void *tv_start));
 void time_pop __ARGS((void *tp));
-void time_msg __ARGS((char *msg, void *tv_start));
+void time_msg __ARGS((char *mesg, void *tv_start));
 void server_to_input_buf __ARGS((char_u *str));
 char_u *eval_client_expr_to_string __ARGS((char_u *expr));
 char_u *serverConvert __ARGS((char_u *client_enc, char_u *data, char_u **tofree));
diff --git a/src/proto/move.pro b/src/proto/move.pro
index f1f3a11..5fe3844 100644
--- a/src/proto/move.pro
+++ b/src/proto/move.pro
@@ -1,5 +1,4 @@
 /* move.c */
-void do_check_cursorbind __ARGS((void));
 void update_topline_redraw __ARGS((void));
 void update_topline __ARGS((void));
 void update_curswant __ARGS((void));
@@ -38,4 +37,5 @@
 void cursor_correct __ARGS((void));
 int onepage __ARGS((int dir, long count));
 void halfpage __ARGS((int flag, linenr_T Prenum));
+void do_check_cursorbind __ARGS((void));
 /* vim: set ft=c : */
diff --git a/src/proto/screen.pro b/src/proto/screen.pro
index 937e4ed..05114d0 100644
--- a/src/proto/screen.pro
+++ b/src/proto/screen.pro
@@ -8,6 +8,7 @@
 void redrawWinline __ARGS((linenr_T lnum, int invalid));
 void update_curbuf __ARGS((int type));
 void update_screen __ARGS((int type));
+void update_single_line __ARGS((win_T *wp, linenr_T lnum));
 void update_debug_sign __ARGS((buf_T *buf, linenr_T lnum));
 void updateWindow __ARGS((win_T *wp));
 void rl_mirror __ARGS((char_u *str));
@@ -46,6 +47,5 @@
 int redrawing __ARGS((void));
 int messaging __ARGS((void));
 void showruler __ARGS((int always));
-void update_single_line __ARGS((win_T *buf, linenr_T lnum));
 int number_width __ARGS((win_T *wp));
 /* vim: set ft=c : */
diff --git a/src/proto/sha256.pro b/src/proto/sha256.pro
index 651a0a0..3c4d975 100644
--- a/src/proto/sha256.pro
+++ b/src/proto/sha256.pro
@@ -4,5 +4,5 @@
 void sha256_finish __ARGS((context_sha256_T *ctx, char_u digest[32]));
 char_u *sha256_key __ARGS((char_u *buf, char_u *salt, int salt_len));
 int sha256_self_test __ARGS((void));
-void sha2_seed __ARGS((char_u header[], int header_len, char_u salt[], int salt_len));
+void sha2_seed __ARGS((char_u *header, int header_len, char_u *salt, int salt_len));
 /* vim: set ft=c : */
diff --git a/src/proto/ui.pro b/src/proto/ui.pro
index b022baa..7b65680 100644
--- a/src/proto/ui.pro
+++ b/src/proto/ui.pro
@@ -47,7 +47,7 @@
 int check_row __ARGS((int row));
 void open_app_context __ARGS((void));
 void x11_setup_atoms __ARGS((Display *dpy));
-void x11_setup_selection __ARGS((Widget myShell));
+void x11_setup_selection __ARGS((Widget w));
 void clip_x11_request_selection __ARGS((Widget myShell, Display *dpy, VimClipboard *cbd));
 void clip_x11_lose_selection __ARGS((Widget myShell, VimClipboard *cbd));
 int clip_x11_own_selection __ARGS((Widget myShell, VimClipboard *cbd));