summaryrefslogtreecommitdiff
path: root/editors/mule/patches
diff options
context:
space:
mode:
authordholland <dholland>2011-12-24 17:07:07 +0000
committerdholland <dholland>2011-12-24 17:07:07 +0000
commit54e41b635fdd35d01692fb135c35abff5a64054c (patch)
tree1697d4a66ec05f87d730ed74a5dfd808d3c60859 /editors/mule/patches
parent7a71fc3d11880ce5312f8a4882567bb204740a5b (diff)
downloadpkgsrc-54e41b635fdd35d01692fb135c35abff5a64054c.tar.gz
Adjust the amd64 patch by crosschecking the existing header for alpha.
Patch extensive use of malloc and alloca without <stdlib.h> and some other stuff that showed up in the build log. Still crashes in temacs but it's getting much farther.
Diffstat (limited to 'editors/mule/patches')
-rw-r--r--editors/mule/patches/patch-ab4
-rw-r--r--editors/mule/patches/patch-ag18
-rw-r--r--editors/mule/patches/patch-ah15
-rw-r--r--editors/mule/patches/patch-ak20
-rw-r--r--editors/mule/patches/patch-am17
-rw-r--r--editors/mule/patches/patch-bd21
-rw-r--r--editors/mule/patches/patch-bw48
-rw-r--r--editors/mule/patches/patch-bx6
-rw-r--r--editors/mule/patches/patch-by28
-rw-r--r--editors/mule/patches/patch-cb17
-rw-r--r--editors/mule/patches/patch-cd17
-rw-r--r--editors/mule/patches/patch-ce19
-rw-r--r--editors/mule/patches/patch-cf17
-rw-r--r--editors/mule/patches/patch-cg15
-rw-r--r--editors/mule/patches/patch-ch11
-rw-r--r--editors/mule/patches/patch-ci18
-rw-r--r--editors/mule/patches/patch-lib-src_bdf_c14
-rw-r--r--editors/mule/patches/patch-lib-src_coco_c12
-rw-r--r--editors/mule/patches/patch-lib-src_etags_c15
-rw-r--r--editors/mule/patches/patch-lib-src_fakelisp_c11
-rw-r--r--editors/mule/patches/patch-lib-src_make-docfile_c15
-rw-r--r--editors/mule/patches/patch-lib-src_profile_c15
-rw-r--r--editors/mule/patches/patch-lib-src_sorted-doc_c33
-rw-r--r--editors/mule/patches/patch-lib-src_yow_c23
-rw-r--r--editors/mule/patches/patch-src_abbrev_c14
-rw-r--r--editors/mule/patches/patch-src_alloc_c19
-rw-r--r--editors/mule/patches/patch-src_buffer_h15
-rw-r--r--editors/mule/patches/patch-src_bytecode_c14
-rw-r--r--editors/mule/patches/patch-src_callint_c14
-rw-r--r--editors/mule/patches/patch-src_charset_c14
-rw-r--r--editors/mule/patches/patch-src_dired_c14
-rw-r--r--editors/mule/patches/patch-src_doc_c14
-rw-r--r--editors/mule/patches/patch-src_doprnt_c14
-rw-r--r--editors/mule/patches/patch-src_editfns_c14
-rw-r--r--editors/mule/patches/patch-src_eval_c14
-rw-r--r--editors/mule/patches/patch-src_keymap_c14
-rw-r--r--editors/mule/patches/patch-src_m_amd64.h31
-rw-r--r--editors/mule/patches/patch-src_macros_c14
-rw-r--r--editors/mule/patches/patch-src_mcpath_c14
-rw-r--r--editors/mule/patches/patch-src_ralloc_c24
-rw-r--r--editors/mule/patches/patch-src_scroll_c14
-rw-r--r--editors/mule/patches/patch-src_search_c15
-rw-r--r--editors/mule/patches/patch-src_term_c15
-rw-r--r--editors/mule/patches/patch-src_textprop_c14
-rw-r--r--editors/mule/patches/patch-src_tparam_c15
-rw-r--r--editors/mule/patches/patch-src_xdisp_c14
-rw-r--r--editors/mule/patches/patch-src_xfaces_c14
-rw-r--r--editors/mule/patches/patch-src_xmenu_c14
48 files changed, 736 insertions, 65 deletions
diff --git a/editors/mule/patches/patch-ab b/editors/mule/patches/patch-ab
index c89b71250b9..fa96c94bb04 100644
--- a/editors/mule/patches/patch-ab
+++ b/editors/mule/patches/patch-ab
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.2 2005/12/01 18:13:24 wiz Exp $
+$NetBSD: patch-ab,v 1.3 2011/12/24 17:07:07 dholland Exp $
--- src/unexelf.c.orig 1994-10-21 05:21:00.000000000 +0100
+++ src/unexelf.c
@@ -466,7 +466,7 @@ $NetBSD: patch-ab,v 1.2 2005/12/01 18:13:24 wiz Exp $
+/*
+ * NetBSD does not have normal-looking user-land ELF support.
+ */
-+# ifdef __alpha__
++# if defined(__alpha__) || defined(__x86_64__) || defined(__sparc64__) || defined(_LP64)
+# define ELFSIZE 64
+# else
+# define ELFSIZE 32
diff --git a/editors/mule/patches/patch-ag b/editors/mule/patches/patch-ag
index 12a19c067f2..dab6b175616 100644
--- a/editors/mule/patches/patch-ag
+++ b/editors/mule/patches/patch-ag
@@ -1,8 +1,20 @@
-$NetBSD: patch-ag,v 1.2 2005/12/01 18:13:24 wiz Exp $
+$NetBSD: patch-ag,v 1.3 2011/12/24 17:07:07 dholland Exp $
---- src/coding.c.orig 1996-09-28 02:41:51.000000000 +0200
+- use standard headers
+- declare external symbols properly
+
+--- src/coding.c.orig 1996-09-28 00:41:51.000000000 +0000
+++ src/coding.c
-@@ -154,7 +154,7 @@ char code_priority_category[IDX_BIN + 1]
+@@ -123,6 +123,8 @@ the Free Software Foundation, 675 Mass A
+ CCL handler changed. */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #ifdef emacs
+ #include <config.h>
+ #include "lisp.h"
+@@ -154,7 +156,7 @@ char code_priority_category[IDX_BIN + 1]
/* 92.4.3, 92.12.18 by K.Handa */
Lisp_Object Qcoding_system, Qcoding_system_p, Qnon_nil_coding_system_p;
Lisp_Object Qeol_type;
diff --git a/editors/mule/patches/patch-ah b/editors/mule/patches/patch-ah
index bc054b6e6f4..c6d7e534bc3 100644
--- a/editors/mule/patches/patch-ah
+++ b/editors/mule/patches/patch-ah
@@ -1,10 +1,15 @@
-$NetBSD: patch-ah,v 1.3 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-ah,v 1.4 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+- don't declare own errno
+- don't rely on "unix" being defined, as it isn't
--- src/fileio.c.orig 1995-06-23 10:25:18.000000000 +0000
+++ src/fileio.c
-@@ -117,10 +117,6 @@ the Free Software Foundation, 675 Mass A
+@@ -117,10 +117,7 @@ the Free Software Foundation, 675 Mass A
#include <errno.h>
++#include <stdlib.h>
-#ifndef vax11c
-extern int errno;
@@ -13,7 +18,7 @@ $NetBSD: patch-ah,v 1.3 2006/01/04 20:35:08 joerg Exp $
extern char *strerror ();
#ifdef APOLLO
-@@ -2604,8 +2600,6 @@ The value is an integer.")
+@@ -2604,8 +2601,6 @@ The value is an integer.")
return value;
}
@@ -22,7 +27,7 @@ $NetBSD: patch-ah,v 1.3 2006/01/04 20:35:08 joerg Exp $
DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "",
"Tell Unix to finish all pending disk updates.")
()
-@@ -2614,8 +2608,6 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sy
+@@ -2614,8 +2609,6 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sy
return Qnil;
}
@@ -31,7 +36,7 @@ $NetBSD: patch-ah,v 1.3 2006/01/04 20:35:08 joerg Exp $
DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0,
"Return t if file FILE1 is newer than file FILE2.\n\
If FILE1 does not exist, the answer is nil;\n\
-@@ -4507,7 +4499,5 @@ This applies only to the operation `inhi
+@@ -4507,7 +4500,5 @@ This applies only to the operation `inhi
defsubr (&Sread_file_name_internal);
defsubr (&Sread_file_name);
diff --git a/editors/mule/patches/patch-ak b/editors/mule/patches/patch-ak
index eac0b4bc858..d7ebd0581a7 100644
--- a/editors/mule/patches/patch-ak
+++ b/editors/mule/patches/patch-ak
@@ -1,8 +1,20 @@
-$NetBSD: patch-ak,v 1.3 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-ak,v 1.4 2011/12/24 17:07:07 dholland Exp $
---- src/keyboard.c.orig 1995-02-03 02:21:28.000000000 +0100
+- use standard headers
+- don't declare own errno
+- declare external symbols properly
+
+--- src/keyboard.c.orig 1995-02-03 01:21:28.000000000 +0000
+++ src/keyboard.c
-@@ -100,8 +100,6 @@ the Free Software Foundation, 675 Mass A
+@@ -53,6 +53,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <config.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #undef NULL
+ #include "termchar.h"
+ #include "termopts.h"
+@@ -100,8 +101,6 @@ the Free Software Foundation, 675 Mass A
/* Include systime.h after xterm.h to avoid double inclusion of time.h. */
#include "systime.h"
@@ -11,7 +23,7 @@ $NetBSD: patch-ak,v 1.3 2006/01/04 20:35:08 joerg Exp $
/* Variables for blockinput.h: */
/* Non-zero if interrupt input is blocked right now. */
-@@ -301,7 +299,7 @@ Lisp_Object Vlast_event_frame;
+@@ -301,7 +300,7 @@ Lisp_Object Vlast_event_frame;
/* The timestamp of the last input event we received from the X server.
X Windows wants this for selection ownership. */
diff --git a/editors/mule/patches/patch-am b/editors/mule/patches/patch-am
index e6d5febf6d2..34937c2ca4a 100644
--- a/editors/mule/patches/patch-am
+++ b/editors/mule/patches/patch-am
@@ -1,8 +1,19 @@
-$NetBSD: patch-am,v 1.2 2005/12/01 18:13:24 wiz Exp $
+$NetBSD: patch-am,v 1.3 2011/12/24 17:07:07 dholland Exp $
---- src/xfns.c.orig 1994-11-04 12:11:24.000000000 +0100
+- use standard headers
+- declare external symbols properly
+
+--- src/xfns.c.orig 1994-11-04 11:11:24.000000000 +0000
+++ src/xfns.c
-@@ -226,7 +226,7 @@ Lisp_Object Qborder_width;
+@@ -23,6 +23,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <signal.h>
+ #include <config.h>
++#include <stdlib.h>
+
+ #if 0
+ #include <stdio.h>
+@@ -226,7 +227,7 @@ Lisp_Object Qborder_width;
Lisp_Object Qbox;
Lisp_Object Qcursor_color;
Lisp_Object Qcursor_type;
diff --git a/editors/mule/patches/patch-bd b/editors/mule/patches/patch-bd
index 7c11b9b264b..66579c384fc 100644
--- a/editors/mule/patches/patch-bd
+++ b/editors/mule/patches/patch-bd
@@ -1,12 +1,25 @@
-$NetBSD: patch-bd,v 1.2 2005/12/01 18:13:24 wiz Exp $
+$NetBSD: patch-bd,v 1.3 2011/12/24 17:07:07 dholland Exp $
---- src/fns.c.orig 1994-10-21 05:20:15.000000000 +0100
+- use standard headers
+
+--- src/fns.c.orig 1994-10-21 04:20:15.000000000 +0000
+++ src/fns.c
-@@ -64,7 +64,9 @@ With argument t, set the random number s
+@@ -24,6 +24,8 @@ the Free Software Foundation, 675 Mass A
+ /* 93.1.15 modified for Mule Ver.0.9.7.1 by Y.Akiba <akiba@cbs.canon.co.jp>
+ Patch for NeXT is updated. */
+
++#include <stdlib.h>
++#include <time.h>
+ #include <config.h>
+
+ /* Note on some machines this defines `vector' as a typedef,
+@@ -64,7 +66,9 @@ With argument t, set the random number s
+ {
+ int val;
unsigned long denominator;
++#if 0
extern long random ();
extern srandom ();
-+#ifndef __NetBSD__
extern long time ();
+#endif
diff --git a/editors/mule/patches/patch-bw b/editors/mule/patches/patch-bw
index 22861fcacde..a41c725f7d8 100644
--- a/editors/mule/patches/patch-bw
+++ b/editors/mule/patches/patch-bw
@@ -1,8 +1,31 @@
-$NetBSD: patch-bw,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-bw,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- lib-src/movemail.c.orig 2006-01-04 17:43:12.000000000 +0000
+- use standard headers
+- don't declare own errno
+- fix malloc usage
+
+--- lib-src/movemail.c.orig 1994-08-04 23:15:22.000000000 +0000
+++ lib-src/movemail.c
-@@ -370,7 +370,6 @@ error (s1, s2, s3)
+@@ -54,6 +54,9 @@ the Free Software Foundation, 675 Mass A
+ #include <sys/stat.h>
+ #include <sys/file.h>
+ #include <errno.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <../src/syswait.h>
+
+ #ifdef MSDOS
+@@ -98,7 +101,7 @@ extern int lk_open (), lk_close ();
+ #undef close
+
+ char *concat ();
+-char *xmalloc ();
++void *xmalloc (size_t);
+ #ifndef errno
+ extern int errno;
+ #endif
+@@ -370,7 +373,6 @@ error (s1, s2, s3)
pfatal_with_name (name)
char *name;
{
@@ -10,7 +33,7 @@ $NetBSD: patch-bw,v 1.1 2006/01/04 20:35:08 joerg Exp $
extern char *strerror ();
char *s;
-@@ -381,7 +380,6 @@ pfatal_with_name (name)
+@@ -381,7 +383,6 @@ pfatal_with_name (name)
pfatal_and_delete (name)
char *name;
{
@@ -18,7 +41,22 @@ $NetBSD: patch-bw,v 1.1 2006/01/04 20:35:08 joerg Exp $
extern char *strerror ();
char *s;
-@@ -747,7 +745,6 @@ multiline (buf, n, f)
+@@ -409,11 +410,10 @@ concat (s1, s2, s3)
+
+ /* Like malloc but get fatal error if memory is exhausted. */
+
+-char *
+-xmalloc (size)
+- unsigned size;
++void *
++xmalloc (size_t size)
+ {
+- char *result = (char *) malloc (size);
++ void *result = (char *) malloc (size);
+ if (!result)
+ fatal ("virtual memory exhausted", 0);
+ return result;
+@@ -747,7 +747,6 @@ multiline (buf, n, f)
char *
get_errmsg ()
{
diff --git a/editors/mule/patches/patch-bx b/editors/mule/patches/patch-bx
index 7dc2502fa3a..32dba218c29 100644
--- a/editors/mule/patches/patch-bx
+++ b/editors/mule/patches/patch-bx
@@ -1,10 +1,12 @@
-$NetBSD: patch-bx,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-bx,v 1.2 2011/12/24 17:07:07 dholland Exp $
--- lib-src/emacsserver.c.orig 2006-01-04 17:43:55.000000000 +0000
+++ lib-src/emacsserver.c
-@@ -56,8 +56,6 @@ main ()
+@@ -56,8 +56,8 @@ main ()
#include <stdio.h>
#include <errno.h>
++#include <stdlib.h>
++#include <string.h>
-extern int errno;
-
diff --git a/editors/mule/patches/patch-by b/editors/mule/patches/patch-by
index 4053e20c1f5..6a6e62b2593 100644
--- a/editors/mule/patches/patch-by
+++ b/editors/mule/patches/patch-by
@@ -1,12 +1,30 @@
-$NetBSD: patch-by,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-by,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- lib-src/timer.c.orig 2006-01-04 17:44:22.000000000 +0000
+- use standard headers
+- don't declare own errno
+
+--- lib-src/timer.c.orig 1995-02-17 07:47:36.000000000 +0000
+++ lib-src/timer.c
-@@ -33,7 +33,6 @@
+@@ -12,7 +12,9 @@
+ esr@snark.thyrsus.com, Aug 7 1992. */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <signal.h>
++#include <time.h>
+ #include <errno.h>
+ #include <sys/types.h> /* time_t */
+
+@@ -33,12 +35,7 @@
#endif
-extern int errno;
extern char *strerror ();
- #ifndef OSF1
- extern char *malloc ();
+-#ifndef OSF1
+-extern char *malloc ();
+-#endif
+-extern time_t time ();
+
+ /*
+ * The field separator for input. This character shouldn't occur in dates,
diff --git a/editors/mule/patches/patch-cb b/editors/mule/patches/patch-cb
index 2e14675dcd4..f2f1ff5af08 100644
--- a/editors/mule/patches/patch-cb
+++ b/editors/mule/patches/patch-cb
@@ -1,8 +1,19 @@
-$NetBSD: patch-cb,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-cb,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- src/dispnew.c.orig 2006-01-04 18:00:54.000000000 +0000
+- use standard headers
+- don't declare own errno
+
+--- src/dispnew.c.orig 1995-02-03 01:21:28.000000000 +0000
+++ src/dispnew.c
-@@ -2047,7 +2047,6 @@ SIGTYPE
+@@ -59,6 +59,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <stdio.h>
+ #include <ctype.h>
++#include <stdlib.h>
+
+ #include "lisp.h"
+ #include "termchar.h"
+@@ -2047,7 +2048,6 @@ SIGTYPE
window_change_signal ()
{
int width, height;
diff --git a/editors/mule/patches/patch-cd b/editors/mule/patches/patch-cd
index 24808ce2c70..0aced7cd13f 100644
--- a/editors/mule/patches/patch-cd
+++ b/editors/mule/patches/patch-cd
@@ -1,8 +1,19 @@
-$NetBSD: patch-cd,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-cd,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- src/xterm.c.orig 2006-01-04 18:04:35.000000000 +0000
+- use standard headers
+- don't declare own errno
+
+--- src/xterm.c.orig 1995-07-22 00:59:57.000000000 +0000
+++ src/xterm.c
-@@ -358,8 +358,6 @@ static int x_noop_count;
+@@ -71,6 +71,7 @@ the Free Software Foundation, 675 Mass A
+ #include <setjmp.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
++#include <stdlib.h>
+
+ #include "dispextern.h"
+ #include "termhooks.h"
+@@ -358,8 +359,6 @@ static int x_noop_count;
static WINDOWINFO_TYPE windowinfo;
diff --git a/editors/mule/patches/patch-ce b/editors/mule/patches/patch-ce
index 9166ba81301..a57744c3581 100644
--- a/editors/mule/patches/patch-ce
+++ b/editors/mule/patches/patch-ce
@@ -1,8 +1,21 @@
-$NetBSD: patch-ce,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-ce,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- src/sysdep.c.orig 2006-01-04 18:25:48.000000000 +0000
+- use standard headers
+- don't declare own errno
+
+--- src/sysdep.c.orig 1995-06-10 03:07:04.000000000 +0000
+++ src/sysdep.c
-@@ -75,8 +75,6 @@ extern int h_errno;
+@@ -20,6 +20,9 @@ the Free Software Foundation, 675 Mass A
+
+ #include <signal.h>
+ #include <setjmp.h>
++#include <string.h>
++#include <stdlib.h>
++#include <unistd.h>
+
+ #include <config.h>
+ #include "lisp.h"
+@@ -75,8 +78,6 @@ extern int h_errno;
#include <sys/param.h>
#endif
diff --git a/editors/mule/patches/patch-cf b/editors/mule/patches/patch-cf
index f534d64f7f2..6cb90cee3aa 100644
--- a/editors/mule/patches/patch-cf
+++ b/editors/mule/patches/patch-cf
@@ -1,8 +1,19 @@
-$NetBSD: patch-cf,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-cf,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- src/filelock.c.orig 2006-01-04 18:27:02.000000000 +0000
+- use standard headers
+- don't declare own errno
+
+--- src/filelock.c.orig 1994-11-11 00:35:51.000000000 +0000
+++ src/filelock.c
-@@ -56,8 +56,6 @@ extern DIR *opendir ();
+@@ -19,6 +19,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <stdlib.h>
+ #include <config.h>
+
+ #ifdef VMS
+@@ -56,8 +57,6 @@ extern DIR *opendir ();
#endif /* not SYSV_SYSTEM_DIR */
#endif /* not MCPATH */
diff --git a/editors/mule/patches/patch-cg b/editors/mule/patches/patch-cg
index 38431db1500..06f2d41ff16 100644
--- a/editors/mule/patches/patch-cg
+++ b/editors/mule/patches/patch-cg
@@ -1,8 +1,19 @@
-$NetBSD: patch-cg,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-cg,v 1.2 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+- don't declare own errno
--- src/process.c.orig 1996-08-15 03:39:14.000000000 +0000
+++ src/process.c
-@@ -191,7 +191,6 @@ static Lisp_Object stream_process;
+@@ -95,6 +95,7 @@ the Free Software Foundation, 675 Mass A
+ #include <stdio.h>
+ #include <errno.h>
+ #include <setjmp.h>
++#include <stdlib.h>
+ #include <sys/types.h> /* some typedefs are used in sys/file.h */
+ #include <sys/file.h>
+ #include <sys/stat.h>
+@@ -191,7 +192,6 @@ static Lisp_Object stream_process;
#include "syswait.h"
diff --git a/editors/mule/patches/patch-ch b/editors/mule/patches/patch-ch
index 9d2623e405c..f093eb46a15 100644
--- a/editors/mule/patches/patch-ch
+++ b/editors/mule/patches/patch-ch
@@ -1,12 +1,17 @@
-$NetBSD: patch-ch,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-ch,v 1.2 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+- don't declare own errno
--- src/callproc.c.orig 2006-01-04 18:33:30.000000000 +0000
+++ src/callproc.c
-@@ -57,7 +57,6 @@ the Free Software Foundation, 675 Mass A
+@@ -57,7 +57,7 @@ the Free Software Foundation, 675 Mass A
#include <config.h>
#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
-extern int errno;
- extern char *strerror ();
+-extern char *strerror ();
/* Define SIGCHLD as an alias for SIGCLD. */
diff --git a/editors/mule/patches/patch-ci b/editors/mule/patches/patch-ci
index 9eae6ea813d..1a24a2ee3ea 100644
--- a/editors/mule/patches/patch-ci
+++ b/editors/mule/patches/patch-ci
@@ -1,8 +1,20 @@
-$NetBSD: patch-ci,v 1.1 2006/01/04 20:35:08 joerg Exp $
+$NetBSD: patch-ci,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- src/xrdb.c.orig 2006-01-04 18:51:03.000000000 +0000
+- use standard headers
+- don't declare own errno
+
+--- src/xrdb.c.orig 1995-02-17 07:55:38.000000000 +0000
+++ src/xrdb.c
-@@ -665,8 +665,6 @@ fatal (msg, prog, x1, x2, x3, x4, x5)
+@@ -22,6 +22,8 @@ the Free Software Foundation, 675 Mass A
+ #endif
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.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 X11 */
+@@ -665,8 +667,6 @@ fatal (msg, prog, x1, x2, x3, x4, x5)
char *msg, *prog;
int x1, x2, x3, x4, x5;
{
diff --git a/editors/mule/patches/patch-lib-src_bdf_c b/editors/mule/patches/patch-lib-src_bdf_c
new file mode 100644
index 00000000000..6c6720e1c77
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_bdf_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-lib-src_bdf_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- lib-src/bdf.c~ 1995-06-15 08:12:59.000000000 +0000
++++ lib-src/bdf.c
+@@ -50,6 +50,7 @@ the Free Software Foundation, 675 Mass A
+ In bdf_load_font(), fontp->extra->fs should not be set in emacs. */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
diff --git a/editors/mule/patches/patch-lib-src_coco_c b/editors/mule/patches/patch-lib-src_coco_c
new file mode 100644
index 00000000000..e6977445ecb
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_coco_c
@@ -0,0 +1,12 @@
+$NetBSD: patch-lib-src_coco_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- lib-src/coco.c~ 1996-04-04 03:43:46.000000000 +0000
++++ lib-src/coco.c
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "mulelib.h"
+
+ #define IN_BUF_SIZE 4096
diff --git a/editors/mule/patches/patch-lib-src_etags_c b/editors/mule/patches/patch-lib-src_etags_c
new file mode 100644
index 00000000000..429a6ec4de8
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_etags_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib-src_etags_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- lib-src/etags.c~ 1994-07-08 10:24:10.000000000 +0000
++++ lib-src/etags.c
+@@ -44,6 +44,8 @@ char pot_etags_version[] = "@(#) pot rev
+ #endif
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <ctype.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
diff --git a/editors/mule/patches/patch-lib-src_fakelisp_c b/editors/mule/patches/patch-lib-src_fakelisp_c
new file mode 100644
index 00000000000..69a803d1361
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_fakelisp_c
@@ -0,0 +1,11 @@
+$NetBSD: patch-lib-src_fakelisp_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- lib-src/fakelisp.c~ 1995-01-06 12:09:02.000000000 +0000
++++ lib-src/fakelisp.c
+@@ -1,3 +1,4 @@
++#include <stdlib.h>
+ #include "fakelisp.h"
+
+ void *Lisp_Object_Table[4096];
diff --git a/editors/mule/patches/patch-lib-src_make-docfile_c b/editors/mule/patches/patch-lib-src_make-docfile_c
new file mode 100644
index 00000000000..2274d14ace2
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_make-docfile_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib-src_make-docfile_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- lib-src/make-docfile.c~ 1994-05-19 21:04:35.000000000 +0000
++++ lib-src/make-docfile.c
+@@ -32,6 +32,8 @@ the Free Software Foundation, 675 Mass A
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #ifdef MSDOS
+ #include <fcntl.h>
+ #endif /* MSDOS */
diff --git a/editors/mule/patches/patch-lib-src_profile_c b/editors/mule/patches/patch-lib-src_profile_c
new file mode 100644
index 00000000000..f64e15909c6
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_profile_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib-src_profile_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- fix void main
+
+--- lib-src/profile.c~ 1994-07-25 23:20:58.000000000 +0000
++++ lib-src/profile.c
+@@ -66,7 +66,7 @@ get_time ()
+ return time_string;
+ }
+
+-void
++int
+ main ()
+ {
+ int c;
diff --git a/editors/mule/patches/patch-lib-src_sorted-doc_c b/editors/mule/patches/patch-lib-src_sorted-doc_c
new file mode 100644
index 00000000000..b8fcaa60c33
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_sorted-doc_c
@@ -0,0 +1,33 @@
+$NetBSD: patch-lib-src_sorted-doc_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+- fix malloc usage
+
+--- lib-src/sorted-doc.c~ 1992-10-07 18:21:09.000000000 +0000
++++ lib-src/sorted-doc.c
+@@ -6,11 +6,10 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <ctype.h>
+
+-extern char *malloc ();
+-char *xmalloc ();
+-
+ #define NUL '\0'
+ #define MARKER '\037'
+
+@@ -56,9 +55,8 @@ error (s1, s2)
+
+ /* Like malloc but get fatal error if memory is exhausted. */
+
+-char *
+-xmalloc (size)
+- int size;
++void *
++xmalloc (size_t size)
+ {
+ char *result = malloc ((unsigned)size);
+ if (result == NULL)
diff --git a/editors/mule/patches/patch-lib-src_yow_c b/editors/mule/patches/patch-lib-src_yow_c
new file mode 100644
index 00000000000..645152ae61d
--- /dev/null
+++ b/editors/mule/patches/patch-lib-src_yow_c
@@ -0,0 +1,23 @@
+$NetBSD: patch-lib-src_yow_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use time() correctly
+
+--- lib-src/yow.c~ 1994-06-07 15:18:54.000000000 +0000
++++ lib-src/yow.c
+@@ -9,6 +9,7 @@
+
+ #include <stdio.h>
+ #include <ctype.h>
++#include <time.h>
+ #include <../src/paths.h> /* For PATH_DATA. */
+
+ #define BUFSIZE 80
+@@ -53,7 +54,7 @@ main (argc, argv)
+ }
+
+ /* initialize random seed */
+- srand((int) (getpid() + time((long *) 0)));
++ srand((int) (getpid() + time(NULL)));
+
+ setup_yow(fp);
+ yow(fp);
diff --git a/editors/mule/patches/patch-src_abbrev_c b/editors/mule/patches/patch-src_abbrev_c
new file mode 100644
index 00000000000..51634c1b33b
--- /dev/null
+++ b/editors/mule/patches/patch-src_abbrev_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_abbrev_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/abbrev.c~ 1993-09-13 11:20:03.000000000 +0000
++++ src/abbrev.c
+@@ -20,6 +20,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <config.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "lisp.h"
+ #include "commands.h"
+ #include "buffer.h"
diff --git a/editors/mule/patches/patch-src_alloc_c b/editors/mule/patches/patch-src_alloc_c
index 911c27cd5f5..6176ef83a93 100644
--- a/editors/mule/patches/patch-src_alloc_c
+++ b/editors/mule/patches/patch-src_alloc_c
@@ -1,12 +1,21 @@
-$NetBSD: patch-src_alloc_c,v 1.1 2011/12/24 13:30:33 dholland Exp $
+$NetBSD: patch-src_alloc_c,v 1.2 2011/12/24 17:07:07 dholland Exp $
+- use standard includes
- add an empty asm() destroying memory that prevents gcc from
optimizing out __malloc_hook and friends (which leads to
SIGSEGV in temacs during build)
---- src/alloc.c~ 1994-10-24 11:37:41.000000000 +0000
+--- src/alloc.c.orig 1994-10-24 11:37:41.000000000 +0000
+++ src/alloc.c
-@@ -240,6 +240,9 @@ emacs_blocked_free (ptr)
+@@ -30,6 +30,7 @@ the Free Software Foundation, 675 Mass A
+ In make_string(), original bug fixed. */
+
+ #include <signal.h>
++#include <stdlib.h>
+
+ #include <config.h>
+ #include "lisp.h"
+@@ -240,6 +241,9 @@ emacs_blocked_free (ptr)
{
BLOCK_INPUT;
__free_hook = old_free_hook;
@@ -16,7 +25,7 @@ $NetBSD: patch-src_alloc_c,v 1.1 2011/12/24 13:30:33 dholland Exp $
free (ptr);
__free_hook = emacs_blocked_free;
UNBLOCK_INPUT;
-@@ -253,6 +256,9 @@ emacs_blocked_malloc (size)
+@@ -253,6 +257,9 @@ emacs_blocked_malloc (size)
BLOCK_INPUT;
__malloc_hook = old_malloc_hook;
@@ -26,7 +35,7 @@ $NetBSD: patch-src_alloc_c,v 1.1 2011/12/24 13:30:33 dholland Exp $
value = (void *) malloc (size);
__malloc_hook = emacs_blocked_malloc;
UNBLOCK_INPUT;
-@@ -269,6 +275,9 @@ emacs_blocked_realloc (ptr, size)
+@@ -269,6 +276,9 @@ emacs_blocked_realloc (ptr, size)
BLOCK_INPUT;
__realloc_hook = old_realloc_hook;
diff --git a/editors/mule/patches/patch-src_buffer_h b/editors/mule/patches/patch-src_buffer_h
new file mode 100644
index 00000000000..94e039983dd
--- /dev/null
+++ b/editors/mule/patches/patch-src_buffer_h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_buffer_h,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/buffer.h~ 1995-06-09 08:31:18.000000000 +0000
++++ src/buffer.h
+@@ -40,6 +40,8 @@ the Free Software Foundation, 675 Mass A
+ /* 93.7.7 modified for Mule Ver.0.9.8 by K.Handa <handa@etl.go.jp>
+ frontmap is introduced. */
+
++#include <stdlib.h>
++
+ #ifdef USE_TEXT_PROPERTIES
+ #define SET_PT(position) (set_point ((position), current_buffer))
+ #define TEMP_SET_PT(position) (temp_set_point ((position), current_buffer))
diff --git a/editors/mule/patches/patch-src_bytecode_c b/editors/mule/patches/patch-src_bytecode_c
new file mode 100644
index 00000000000..f01f3e22248
--- /dev/null
+++ b/editors/mule/patches/patch-src_bytecode_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_bytecode_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/bytecode.c~ 1994-10-21 04:19:49.000000000 +0000
++++ src/bytecode.c
+@@ -34,6 +34,7 @@ by Hallvard:
+
+ /* 92.3.6 modified for Mule Ver.0.9.0 by K.Handa <handa@etl.go.jp> */
+
++#include <stdlib.h>
+ #include <config.h>
+ #include "lisp.h"
+ #include "buffer.h"
diff --git a/editors/mule/patches/patch-src_callint_c b/editors/mule/patches/patch-src_callint_c
new file mode 100644
index 00000000000..05da56f5a32
--- /dev/null
+++ b/editors/mule/patches/patch-src_callint_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_callint_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/callint.c~ 1994-10-21 04:19:49.000000000 +0000
++++ src/callint.c
+@@ -24,6 +24,7 @@ the Free Software Foundation, 675 Mass A
+ /* 93.3.18 modified for Mule Ver.0.9.7.1 by K.Handa <handa@etl.go.jp>
+ Document of 'interactive' updated. */
+
++#include <stdlib.h>
+ #include <config.h>
+ #include "lisp.h"
+ #include "buffer.h"
diff --git a/editors/mule/patches/patch-src_charset_c b/editors/mule/patches/patch-src_charset_c
new file mode 100644
index 00000000000..f3ebed0312e
--- /dev/null
+++ b/editors/mule/patches/patch-src_charset_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_charset_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/charset.c~ 1995-07-18 11:35:56.000000000 +0000
++++ src/charset.c
+@@ -73,6 +73,7 @@ the Free Software Foundation, 675 Mass A
+ #include <sys/types.h>
+ #include <config.h>
+ #else /* not emacs */
++#include <stdlib.h>
+ #define xmalloc (void *)malloc
+ #define xrealloc (void *)realloc
+ #endif /* emacs */
diff --git a/editors/mule/patches/patch-src_dired_c b/editors/mule/patches/patch-src_dired_c
new file mode 100644
index 00000000000..e29abeb6168
--- /dev/null
+++ b/editors/mule/patches/patch-src_dired_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_dired_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/dired.c~ 1994-11-11 00:35:50.000000000 +0000
++++ src/dired.c
+@@ -21,6 +21,7 @@ the Free Software Foundation, 675 Mass A
+ #include <config.h>
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+
diff --git a/editors/mule/patches/patch-src_doc_c b/editors/mule/patches/patch-src_doc_c
new file mode 100644
index 00000000000..ce66c73d1e9
--- /dev/null
+++ b/editors/mule/patches/patch-src_doc_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_doc_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/doc.c~ 1994-10-21 04:20:03.000000000 +0000
++++ src/doc.c
+@@ -22,6 +22,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <sys/types.h>
+ #include <sys/file.h> /* Must be after sys/types.h for USG and BSD4_1*/
++#include <stdlib.h>
+
+ #ifdef USG5
+ #include <fcntl.h>
diff --git a/editors/mule/patches/patch-src_doprnt_c b/editors/mule/patches/patch-src_doprnt_c
new file mode 100644
index 00000000000..615647a825d
--- /dev/null
+++ b/editors/mule/patches/patch-src_doprnt_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_doprnt_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/doprnt.c~ 1994-10-24 12:24:27.000000000 +0000
++++ src/doprnt.c
+@@ -29,6 +29,7 @@ the Free Software Foundation, 675 Mass A
+ #include <config.h>
+ #include <stdio.h>
+ #include <ctype.h>
++#include <stdlib.h>
+
+ #include "lisp.h"
+ #include "charset.h"
diff --git a/editors/mule/patches/patch-src_editfns_c b/editors/mule/patches/patch-src_editfns_c
new file mode 100644
index 00000000000..c09a0403579
--- /dev/null
+++ b/editors/mule/patches/patch-src_editfns_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_editfns_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/editfns.c~ 1994-10-24 04:23:21.000000000 +0000
++++ src/editfns.c
+@@ -46,6 +46,7 @@ the Free Software Foundation, 675 Mass A
+ char_to_string() and string_to_char() completely re-written. */
+
+ #include <sys/types.h>
++#include <stdlib.h>
+
+ #include <config.h>
+
diff --git a/editors/mule/patches/patch-src_eval_c b/editors/mule/patches/patch-src_eval_c
new file mode 100644
index 00000000000..3325d6e7178
--- /dev/null
+++ b/editors/mule/patches/patch-src_eval_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_eval_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/eval.c~ 1994-10-21 04:20:08.000000000 +0000
++++ src/eval.c
+@@ -24,6 +24,7 @@ the Free Software Foundation, 675 Mass A
+ /* 93.7.8 modified for Mule Ver.0.9.8 by T.Atsushiba <toshiki@jit.dec.co.jp>
+ Function type declaration of call4(). */
+
++#include <stdlib.h>
+ #include <config.h>
+ #include "lisp.h"
+ #include "blockinput.h"
diff --git a/editors/mule/patches/patch-src_keymap_c b/editors/mule/patches/patch-src_keymap_c
new file mode 100644
index 00000000000..02f13a52386
--- /dev/null
+++ b/editors/mule/patches/patch-src_keymap_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_keymap_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/keymap.c~ 1994-10-24 12:30:52.000000000 +0000
++++ src/keymap.c
+@@ -31,6 +31,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <config.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #undef NULL
+ #include "lisp.h"
+ #include "commands.h"
diff --git a/editors/mule/patches/patch-src_m_amd64.h b/editors/mule/patches/patch-src_m_amd64.h
index e5c12840a25..483b072e33a 100644
--- a/editors/mule/patches/patch-src_m_amd64.h
+++ b/editors/mule/patches/patch-src_m_amd64.h
@@ -1,8 +1,10 @@
-$NetBSD: patch-src_m_amd64.h,v 1.1 2011/12/20 18:33:40 ryoon Exp $
+$NetBSD: patch-src_m_amd64.h,v 1.2 2011/12/24 17:07:07 dholland Exp $
---- src/m/amd64.h.orig 2011-12-20 18:27:24.000000000 +0000
+amd64 support.
+
+--- src/m/amd64.h.orig 2011-12-24 14:41:29.000000000 +0000
+++ src/m/amd64.h
-@@ -0,0 +1,141 @@
+@@ -0,0 +1,156 @@
+/* machine description file for AMD x86-64.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
@@ -30,9 +32,17 @@ $NetBSD: patch-src_m_amd64.h,v 1.1 2011/12/20 18:33:40 ryoon Exp $
+
+#define SHORTBITS 16 /* Number of bits in a short */
+
-+#define INTBITS 32 /* Number of bits in an int */
++#define INTBITS 32L /* Number of bits in an int */
++
++#define LONGBITS 64L /* Number of bits in a long */
++
++/* Define LONG_LISP_OBJECT if you define LISP_OBJECT as long. */
++
++#define LONG_LISP_OBJECT
+
-+#define LONGBITS 64 /* Number of bits in a long */
++/* Define the number of bits compose Lisp_Object. The default is 32. */
++
++#define LISP_OBJECT_BITS 64
+
+/* The following line tells the configuration script what sort of
+ operating system this machine is likely to run.
@@ -41,10 +51,10 @@ $NetBSD: patch-src_m_amd64.h,v 1.1 2011/12/20 18:33:40 ryoon Exp $
+#define BITS_PER_LONG 64
+#define BITS_PER_EMACS_INT 64
+
-+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
++/* Define BIG_ENDIAN iff lowest-numbered byte in a word
+ is the most significant byte. */
+
-+#undef WORDS_BIG_ENDIAN
++#undef BIG_ENDIAN
+
+/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
+ * group of arguments and treat it as an array of the arguments. */
@@ -56,6 +66,11 @@ $NetBSD: patch-src_m_amd64.h,v 1.1 2011/12/20 18:33:40 ryoon Exp $
+
+/* #define WORD_MACHINE */
+
++/* Define how to take a char and sign-extend into an int.
++ On machines where char is signed, this is a no-op. */
++
++#define SIGN_EXTEND_CHAR(c) ((signed char)(c))
++
+/* Now define a symbol for the cpu type, if your compiler
+ does not define it automatically:
+ Ones defined so far include vax, m68000, ns16000, pyramid,
@@ -122,6 +137,7 @@ $NetBSD: patch-src_m_amd64.h,v 1.1 2011/12/20 18:33:40 ryoon Exp $
+
+#define PNTR_COMPARISON_TYPE unsigned long
+
++#if 0
+/* On the 64 bit architecture, we can use 60 bits for addresses */
+
+#define VALBITS 60
@@ -134,6 +150,7 @@ $NetBSD: patch-src_m_amd64.h,v 1.1 2011/12/20 18:33:40 ryoon Exp $
+/* Define XINT and XUINT so that they can take arguments of type int */
+#define XINT(a) (((long) (a) << (BITS_PER_LONG - VALBITS)) >> (BITS_PER_LONG - VALBITS))
+#define XUINT(a) ((long) (a) & VALMASK)
++#endif
+
+/* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
+
diff --git a/editors/mule/patches/patch-src_macros_c b/editors/mule/patches/patch-src_macros_c
new file mode 100644
index 00000000000..58f83f622a9
--- /dev/null
+++ b/editors/mule/patches/patch-src_macros_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_macros_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/macros.c~ 1993-09-12 01:21:02.000000000 +0000
++++ src/macros.c
+@@ -18,6 +18,7 @@ along with GNU Emacs; see the file COPYI
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
++#include <stdlib.h>
+ #include <config.h>
+ #include "lisp.h"
+ #include "macros.h"
diff --git a/editors/mule/patches/patch-src_mcpath_c b/editors/mule/patches/patch-src_mcpath_c
new file mode 100644
index 00000000000..c2cdbd3af7b
--- /dev/null
+++ b/editors/mule/patches/patch-src_mcpath_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_mcpath_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/mcpath.c~ 1995-08-01 10:41:51.000000000 +0000
++++ src/mcpath.c
+@@ -25,6 +25,7 @@ the Free Software Foundation, 675 Mass A
+
+ #define MCPATH_SOURCE
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
diff --git a/editors/mule/patches/patch-src_ralloc_c b/editors/mule/patches/patch-src_ralloc_c
new file mode 100644
index 00000000000..99585776e9a
--- /dev/null
+++ b/editors/mule/patches/patch-src_ralloc_c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_ralloc_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/ralloc.c~ 1993-11-18 09:23:35.000000000 +0000
++++ src/ralloc.c
+@@ -25,6 +25,8 @@ the Free Software Foundation, 675 Mass A
+
+ #ifdef emacs
+
++#include <stdlib.h>
++#include <string.h>
+ #include <config.h>
+ #include "lisp.h" /* Needed for VALBITS. */
+
+@@ -66,7 +68,7 @@ typedef size_t SIZE;
+ typedef void *POINTER;
+
+ #include <unistd.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ #include <string.h>
+
+ #define safe_bcopy(x, y, z) memmove (y, x, z)
diff --git a/editors/mule/patches/patch-src_scroll_c b/editors/mule/patches/patch-src_scroll_c
new file mode 100644
index 00000000000..c088b196cc8
--- /dev/null
+++ b/editors/mule/patches/patch-src_scroll_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_scroll_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/scroll.c~ 1994-05-04 02:30:01.000000000 +0000
++++ src/scroll.c
+@@ -18,6 +18,7 @@ along with GNU Emacs; see the file COPYI
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
++#include <stdlib.h>
+ #include <config.h>
+ #include "termchar.h"
+ #include "lisp.h"
diff --git a/editors/mule/patches/patch-src_search_c b/editors/mule/patches/patch-src_search_c
new file mode 100644
index 00000000000..4a12e12ce15
--- /dev/null
+++ b/editors/mule/patches/patch-src_search_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_search_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/regex19.c.~3~ 1996-07-16 01:44:24.000000000 +0000
++++ src/regex19.c
+@@ -25,6 +25,8 @@
+ #pragma alloca
+ #endif
+
++#include <stdlib.h>
++
+ #define _GNU_SOURCE
+
+ #ifdef HAVE_CONFIG_H
diff --git a/editors/mule/patches/patch-src_term_c b/editors/mule/patches/patch-src_term_c
new file mode 100644
index 00000000000..184a11cf390
--- /dev/null
+++ b/editors/mule/patches/patch-src_term_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_term_c,v 1.1 2011/12/24 17:07:07 dholland Exp $
+
+- use standard headers
+
+--- src/term.c~ 1995-01-06 05:57:00.000000000 +0000
++++ src/term.c
+@@ -52,7 +52,8 @@ the Free Software Foundation, 675 Mass A
+ Macro definition of ITNCODE and AUTOCONV switched. */
+
+ #include <config.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <ctype.h>
+ #include "termchar.h"
+ #include "termopts.h"
diff --git a/editors/mule/patches/patch-src_textprop_c b/editors/mule/patches/patch-src_textprop_c
new file mode 100644
index 00000000000..c9aa81c4db0
--- /dev/null
+++ b/editors/mule/patches/patch-src_textprop_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_textprop_c,v 1.1 2011/12/24 17:07:08 dholland Exp $
+
+- use standard headers
+
+--- src/textprop.c~ 1994-11-04 11:11:20.000000000 +0000
++++ src/textprop.c
+@@ -17,6 +17,7 @@ You should have received a copy of the G
+ along with GNU Emacs; see the file COPYING. If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
++#include <stdlib.h>
+ #include <config.h>
+ #include "lisp.h"
+ #include "intervals.h"
diff --git a/editors/mule/patches/patch-src_tparam_c b/editors/mule/patches/patch-src_tparam_c
new file mode 100644
index 00000000000..8ea0ac61586
--- /dev/null
+++ b/editors/mule/patches/patch-src_tparam_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_tparam_c,v 1.1 2011/12/24 17:07:08 dholland Exp $
+
+- lp64 fixes
+
+--- src/tparam.c~ 1995-02-17 07:58:11.000000000 +0000
++++ src/tparam.c
+@@ -69,7 +69,7 @@ xrealloc (ptr, size)
+ return tem;
+ }
+ #else
+-#ifdef OSF1
++#if defined(OSF1) || defined(_LP64)
+ extern long *xmalloc();
+ extern long *xrealloc();
+ #endif
diff --git a/editors/mule/patches/patch-src_xdisp_c b/editors/mule/patches/patch-src_xdisp_c
new file mode 100644
index 00000000000..09e2f607d8e
--- /dev/null
+++ b/editors/mule/patches/patch-src_xdisp_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_xdisp_c,v 1.1 2011/12/24 17:07:08 dholland Exp $
+
+- use standard headers
+
+--- src/xdisp.c~ 1996-03-06 08:08:03.000000000 +0000
++++ src/xdisp.c
+@@ -68,6 +68,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <config.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ /*#include <ctype.h>*/
+ #undef NULL
+ #include "lisp.h"
diff --git a/editors/mule/patches/patch-src_xfaces_c b/editors/mule/patches/patch-src_xfaces_c
new file mode 100644
index 00000000000..27e122da5ec
--- /dev/null
+++ b/editors/mule/patches/patch-src_xfaces_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_xfaces_c,v 1.1 2011/12/24 17:07:08 dholland Exp $
+
+- use standard headers
+
+--- src/xfaces.c~ 1995-07-18 08:14:26.000000000 +0000
++++ src/xfaces.c
+@@ -21,6 +21,7 @@ the Free Software Foundation, 675 Mass A
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <stdlib.h>
+
+ #include <config.h>
+ #include "lisp.h"
diff --git a/editors/mule/patches/patch-src_xmenu_c b/editors/mule/patches/patch-src_xmenu_c
new file mode 100644
index 00000000000..a7c5ef07fb7
--- /dev/null
+++ b/editors/mule/patches/patch-src_xmenu_c
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_xmenu_c,v 1.1 2011/12/24 17:07:08 dholland Exp $
+
+- use standard headers
+
+--- src/xmenu.c~ 1995-02-17 07:47:37.000000000 +0000
++++ src/xmenu.c
+@@ -34,6 +34,7 @@ the Free Software Foundation, 675 Mass A
+ #include <config.h>
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "lisp.h"
+ #include "termhooks.h"
+ #include "frame.h"