aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-09-30 10:44:37 -0700
committerPaul Eggert2011-09-30 10:44:37 -0700
commit535272bb73eff5a5db01301e5b60f6128d6dc788 (patch)
treeb41937c81a61bf737ef15efb434fc06338da25b4
parent38532ce6ecb33efee5f697886d9fd20a3c2cda01 (diff)
parentf701dc2abbcfb64c0c4d02ac899dccb03ee2b246 (diff)
downloademacs-535272bb73eff5a5db01301e5b60f6128d6dc788.tar.gz
emacs-535272bb73eff5a5db01301e5b60f6128d6dc788.zip
Merge from trunk.
-rw-r--r--ChangeLog8
-rw-r--r--config.bat4
-rw-r--r--lisp/ChangeLog33
-rw-r--r--lisp/descr-text.el5
-rw-r--r--lisp/help.el11
-rw-r--r--lisp/pcmpl-cvs.el4
-rw-r--r--lisp/simple.el18
-rw-r--r--lisp/startup.el16
-rw-r--r--lisp/window.el9
-rw-r--r--msdos/ChangeLog36
-rw-r--r--msdos/inttypes.h1
-rw-r--r--msdos/mainmake.v210
-rw-r--r--msdos/sed1v2.inp6
-rw-r--r--msdos/sed2v2.inp12
-rw-r--r--msdos/sedlibmk.inp43
-rw-r--r--src/ChangeLog73
-rw-r--r--src/alloc.c43
-rw-r--r--src/charset.c36
-rw-r--r--src/nsterm.m18
-rw-r--r--src/sysdep.c4
20 files changed, 306 insertions, 84 deletions
diff --git a/ChangeLog b/ChangeLog
index c1a80f2d92f..3e76c91b196 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12011-09-29 Eli Zaretskii <eliz@gnu.org>
2
3 * .bzrignore: Add ./GNUmakefile.unix, lib/SYS, lib/alloca.in-h,
4 lib/signal.in-h.
5
6 * config.bat: Rename GNUmakefile, so it is not run on MS-DOS.
7 Rename signal.in.h and alloca.in.h.
8
12011-09-28 Eli Zaretskii <eliz@gnu.org> 92011-09-28 Eli Zaretskii <eliz@gnu.org>
2 10
3 * INSTALL: Mention that m17n libraries and libotf are needed for 11 * INSTALL: Mention that m17n libraries and libotf are needed for
diff --git a/config.bat b/config.bat
index a3660d577cd..cbbcf0cfcd5 100644
--- a/config.bat
+++ b/config.bat
@@ -279,8 +279,10 @@ If Exist build-aux\snippet\c++defs.h update build-aux/snippet/c++defs.h build-au
279cd lib 279cd lib
280Rem Rename files like djtar on plain DOS filesystem would. 280Rem Rename files like djtar on plain DOS filesystem would.
281If Exist build-aux\snippet\c++defs.h update build-aux/snippet/c++defs.h build-aux/snippet/cxxdefs.h 281If Exist build-aux\snippet\c++defs.h update build-aux/snippet/c++defs.h build-aux/snippet/cxxdefs.h
282If Exist alloca.in.h update alloca.in.h alloca.in-h
282If Exist getopt.in.h update getopt.in.h getopt.in-h 283If Exist getopt.in.h update getopt.in.h getopt.in-h
283If Exist stdbool.in.h update stdbool.in.h stdbool.in-h 284If Exist stdbool.in.h update stdbool.in.h stdbool.in-h
285If Exist signal.in.h update signal.in.h signal.in-h
284If Exist stddef.in.h update stddef.in.h stddef.in-h 286If Exist stddef.in.h update stddef.in.h stddef.in-h
285If Exist stdint.in.h update stdint.in.h stdint.in-h 287If Exist stdint.in.h update stdint.in.h stdint.in-h
286If Exist stdio.in.h update stdio.in.h stdio.in-h 288If Exist stdio.in.h update stdio.in.h stdio.in-h
@@ -326,6 +328,8 @@ Echo Then run CONFIG.BAT again with the same arguments you did now.
326goto End 328goto End
327:gdbinitOk 329:gdbinitOk
328Echo Looking for the GDB init file...found 330Echo Looking for the GDB init file...found
331rem GNUMakefile is not appropriate for MS-DOS so move it out of the way
332If Exist GNUmakefile mv -f GNUmakefile GNUmakefile.unix
329copy msdos\mainmake.v2 Makefile >nul 333copy msdos\mainmake.v2 Makefile >nul
330rem ---------------------------------------------------------------------- 334rem ----------------------------------------------------------------------
331goto End 335goto End
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f83dbdd344a..38651d42596 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,38 @@
12011-09-30 Martin Rudalics <rudalics@gmx.at>
2
3 * startup.el (command-line-1): Fix last fix by inserting
4 initial-scratch-message into *scratch* before displaying it.
5 (Bug#9605) and (Bug#9636)
6
72011-09-29 Eli Zaretskii <eliz@gnu.org>
8
9 * simple.el (line-move): If auto-hscroll-mode is disabled and the
10 window is hscrolled, move by logical lines. (Bug#9607)
11 (line-move-visual): Update the doc string to the above effect.
12
132011-09-29 Martin Rudalics <rudalics@gmx.at>
14
15 * window.el (display-buffer-record-window): When WINDOW is the
16 selected window use `point' instead of `window-point'. (Bug#9626)
17
18 * startup.el (command-line-1): Use insert-before-markers when
19 inserting initial-scratch-message. (Bug#9605)
20
21 * help.el (help-window): Remove variable.
22
232011-09-29 Glenn Morris <rgm@gnu.org>
24
25 * pcmpl-cvs.el (pcomplete/cvs): Add "status" handler.
26
272011-09-29 Juanma Barranquero <lekktu@gmail.com>
28
29 * descr-text.el (describe-char-categories): Accept category
30 descriptions more than one line long.
31
12011-09-28 Stefan Monnier <monnier@iro.umontreal.ca> 322011-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 33
34 * simple.el (delete-trailing-whitespace): Fix last change.
35
3 * progmodes/perl-mode.el (perl-syntax-propertize-function): 36 * progmodes/perl-mode.el (perl-syntax-propertize-function):
4 Don't confuse "y => 3" as the beginning of a `y' operation. 37 Don't confuse "y => 3" as the beginning of a `y' operation.
5 38
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index fca06adb2a9..7d267cec480 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -366,9 +366,10 @@ This function is semi-obsolete. Use `get-char-code-property'."
366 (list (mapconcat 366 (list (mapconcat
367 (lambda (x) 367 (lambda (x)
368 (let* ((c (category-docstring x)) 368 (let* ((c (category-docstring x))
369 (doc (if (string-match "\\`\\(.*?\\)\n\\(.*\\)\\'" c) 369 (doc (if (string-match "\\`\\(.*?\\)\n" c)
370 (propertize (match-string 1 c) 370 (propertize (match-string 1 c)
371 'help-echo (match-string 2 c)) 371 'help-echo
372 (substring c (1+ (match-end 1))))
372 c))) 373 c)))
373 (format "%c:%s" x doc))) 374 (format "%c:%s" x doc)))
374 mnemonics ", "))))) 375 mnemonics ", ")))))
diff --git a/lisp/help.el b/lisp/help.el
index f4338c28ffb..e2af0759a65 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -37,17 +37,6 @@
37(add-hook 'temp-buffer-setup-hook 'help-mode-setup) 37(add-hook 'temp-buffer-setup-hook 'help-mode-setup)
38(add-hook 'temp-buffer-show-hook 'help-mode-finish) 38(add-hook 'temp-buffer-show-hook 'help-mode-finish)
39 39
40;; The variable `help-window' below is used by `help-mode-finish' to
41;; communicate the window displaying help (the "help window") to the
42;; macro `with-help-window'. The latter sets `help-window' to t before
43;; invoking `with-output-to-temp-buffer'. If and only if `help-window'
44;; is eq to t, `help-mode-finish' (called by `temp-buffer-setup-hook')
45;; sets `help-window' to the window selected by `display-buffer'.
46;; Exiting `with-help-window' and calling `help-print-return-message'
47;; reset `help-window' to nil.
48(defvar help-window nil
49 "Window chosen for displaying help.")
50
51;; `help-window-point-marker' is a marker you can move to a valid 40;; `help-window-point-marker' is a marker you can move to a valid
52;; position of the buffer shown in the help window in order to override 41;; position of the buffer shown in the help window in order to override
53;; the standard positioning mechanism (`point-min') chosen by 42;; the standard positioning mechanism (`point-min') chosen by
diff --git a/lisp/pcmpl-cvs.el b/lisp/pcmpl-cvs.el
index 3ff07bca20e..9c9b72ab701 100644
--- a/lisp/pcmpl-cvs.el
+++ b/lisp/pcmpl-cvs.el
@@ -107,6 +107,10 @@
107 "j(pcmpl-cvs-tags '(?U ?P))" 107 "j(pcmpl-cvs-tags '(?U ?P))"
108 "I(pcmpl-cvs-entries '(??))W?")) 108 "I(pcmpl-cvs-entries '(??))W?"))
109 (while (pcomplete-here (pcmpl-cvs-entries '(?U ?P))))) 109 (while (pcomplete-here (pcmpl-cvs-entries '(?U ?P)))))
110 ((pcomplete-test "status")
111 (setq pcomplete-help "(cvs)File status")
112 (pcomplete-opt "vlR")
113 (while (pcomplete-here (pcmpl-cvs-entries))))
110 (t 114 (t
111 (while (pcomplete-here (pcmpl-cvs-entries))))))) 115 (while (pcomplete-here (pcmpl-cvs-entries)))))))
112 116
diff --git a/lisp/simple.el b/lisp/simple.el
index 142270930ca..1ab90792bfa 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -589,9 +589,9 @@ If the region is active, only delete whitespace within the region."
589 ;; Delete trailing empty lines. 589 ;; Delete trailing empty lines.
590 (goto-char end-marker) 590 (goto-char end-marker)
591 (when (and (not end) 591 (when (and (not end)
592 (<= (skip-chars-backward "\n") -2)
593 ;; Really the end of buffer. 592 ;; Really the end of buffer.
594 (save-restriction (widen) (eobp))) 593 (save-restriction (widen) (eobp))
594 (<= (skip-chars-backward "\n") -2))
595 (delete-region (1+ (point)) end-marker)) 595 (delete-region (1+ (point)) end-marker))
596 (set-marker end-marker nil)))) 596 (set-marker end-marker nil))))
597 ;; Return nil for the benefit of `write-file-functions'. 597 ;; Return nil for the benefit of `write-file-functions'.
@@ -4244,7 +4244,9 @@ screen, instead of relying on buffer contents alone. It takes
4244into account variable-width characters and line continuation. 4244into account variable-width characters and line continuation.
4245If nil, `line-move' moves point by logical lines. 4245If nil, `line-move' moves point by logical lines.
4246A non-nil setting of `goal-column' overrides the value of this variable 4246A non-nil setting of `goal-column' overrides the value of this variable
4247and forces movement by logical lines." 4247and forces movement by logical lines.
4248Disabling `auto-hscroll-mode' also overrides forces movement by logical
4249lines when the window is horizontally scrolled."
4248 :type 'boolean 4250 :type 'boolean
4249 :group 'editing-basics 4251 :group 'editing-basics
4250 :version "23.1") 4252 :version "23.1")
@@ -4321,7 +4323,15 @@ and forces movement by logical lines."
4321 (not executing-kbd-macro) 4323 (not executing-kbd-macro)
4322 (line-move-partial arg noerror to-end)) 4324 (line-move-partial arg noerror to-end))
4323 (set-window-vscroll nil 0 t) 4325 (set-window-vscroll nil 0 t)
4324 (if (and line-move-visual (not goal-column)) 4326 (if (and line-move-visual
4327 ;; Display-based column are incompatible with goal-column.
4328 (not goal-column)
4329 ;; When auto-hscroll-mode is turned off and the text in
4330 ;; the window is scrolled to the left, display-based
4331 ;; motion doesn't make sense (because each logical line
4332 ;; occupies exactly one screen line).
4333 (not (and (null auto-hscroll-mode)
4334 (> (window-hscroll) 0))))
4325 (line-move-visual arg noerror) 4335 (line-move-visual arg noerror)
4326 (line-move-1 arg noerror to-end)))) 4336 (line-move-1 arg noerror to-end))))
4327 4337
diff --git a/lisp/startup.el b/lisp/startup.el
index 6c3bb397e9a..16cf41506bd 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -2307,13 +2307,13 @@ A fancy display is used on graphic displays, normal otherwise."
2307 ;; abort later. 2307 ;; abort later.
2308 (unless (frame-live-p (selected-frame)) (kill-emacs nil)))))) 2308 (unless (frame-live-p (selected-frame)) (kill-emacs nil))))))
2309 2309
2310 (when initial-buffer-choice 2310 (when (eq initial-buffer-choice t)
2311 (cond ((eq initial-buffer-choice t) 2311 ;; When initial-buffer-choice equals t make sure that *scratch*
2312 (switch-to-buffer (get-buffer-create "*scratch*"))) 2312 ;; exists.
2313 ((stringp initial-buffer-choice) 2313 (get-buffer-create "*scratch*"))
2314 (find-file initial-buffer-choice))))
2315 2314
2316 ;; If *scratch* exists and is empty, insert initial-scratch-message. 2315 ;; If *scratch* exists and is empty, insert initial-scratch-message.
2316 ;; Do this before switching to *scratch* below to handle bug#9605.
2317 (and initial-scratch-message 2317 (and initial-scratch-message
2318 (get-buffer "*scratch*") 2318 (get-buffer "*scratch*")
2319 (with-current-buffer "*scratch*" 2319 (with-current-buffer "*scratch*"
@@ -2321,6 +2321,12 @@ A fancy display is used on graphic displays, normal otherwise."
2321 (insert initial-scratch-message) 2321 (insert initial-scratch-message)
2322 (set-buffer-modified-p nil)))) 2322 (set-buffer-modified-p nil))))
2323 2323
2324 (when initial-buffer-choice
2325 (cond ((eq initial-buffer-choice t)
2326 (switch-to-buffer (get-buffer-create "*scratch*")))
2327 ((stringp initial-buffer-choice)
2328 (find-file initial-buffer-choice))))
2329
2324 (if (or inhibit-startup-screen 2330 (if (or inhibit-startup-screen
2325 initial-buffer-choice 2331 initial-buffer-choice
2326 noninteractive 2332 noninteractive
diff --git a/lisp/window.el b/lisp/window.el
index 512eebcc663..c6722a62c74 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3833,7 +3833,14 @@ element is BUFFER."
3833 (list 'other 3833 (list 'other
3834 ;; A quadruple of WINDOW's buffer, start, point and height. 3834 ;; A quadruple of WINDOW's buffer, start, point and height.
3835 (list (window-buffer window) (window-start window) 3835 (list (window-buffer window) (window-start window)
3836 (window-point window) (window-total-size window)) 3836 (if (eq window (selected-window))
3837 ;; When WINDOW is the selected window use its
3838 ;; buffer's `point' instead of `window-point'
3839 ;; (Bug#9626).
3840 (with-current-buffer (window-buffer window)
3841 (point))
3842 (window-point window))
3843 (window-total-size window))
3837 (selected-window) buffer)))) 3844 (selected-window) buffer))))
3838 ((eq type 'window) 3845 ((eq type 'window)
3839 ;; WINDOW has been created on an existing frame. 3846 ;; WINDOW has been created on an existing frame.
diff --git a/msdos/ChangeLog b/msdos/ChangeLog
index 46a5b69cc16..78ea6ebf1c5 100644
--- a/msdos/ChangeLog
+++ b/msdos/ChangeLog
@@ -1,3 +1,39 @@
12011-09-29 Eli Zaretskii <eliz@gnu.org>
2
3 * mainmake.v2 (boot): Condition the value on the existence of
4 autogen/README, not admin/admin.el, since the latter is now part
5 of the release tarball.
6 (install): Don't copy lib-src/fns.el, as that file is no longer
7 generated in that directory.
8
9 * sed1v2.inp (LIB_PTHREAD, LIB_PTHREAD_SIGMASK): Edit to empty.
10 (SETTINGS_CFLAGS, SETTINGS_LIBS): Edit these instead of
11 GCONF_CFLAGS and GCONF_LIBS.
12
13 * sedlibmk.inp (ALLOCA_H, AR, ARFLAGS, GNULIB_CHDIR, GNULIB_DUP)
14 (GNULIB_FDATASYNC, GNULIB_FDOPEN, GNULIB_FSTAT, GNULIB_PCLOSE)
15 (GNULIB_PTHREAD_SIGMASK, GNULIB_RAISE, GNULIB_SIGACTION)
16 (GNULIB_SIGPROCMASK, GNULIB_SIGNAL_H_SIGPIPE, HAVE_FDATASYNC)
17 (HAVE_PCLOSE, HAVE_POPEN, HAVE_POSIX_SIGNALBLOCKING)
18 (HAVE_PTHREAD_SIGMASK, HAVE_RAISE, HAVE_SIGACTION)
19 (HAVE_SIGHANDLER_T, HAVE_SIGINFO_T, HAVE_SIGSET_T)
20 (HAVE_STRUCT_SIGACTION_SA_SIGACTION)
21 (HAVE_TYPE_VOLATILE_SIG_ATOMIC_T, LIB_PTHREAD)
22 (LIB_PTHREAD_SIGMASK, NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H)
23 (NEXT_SIGNAL_H, REPLACE_FDOPEN, REPLACE_PTHREAD_SIGMASK)
24 (REPLACE_RAISE): New edits.
25 (gl_LIBOBJS): Remove md5.o, filemode.o, and sha1.o. Add
26 pthread_sigmask.o.
27 (@GL_GENERATE_ALLOCA_H_TRUE@, @GL_GENERATE_ALLOCA_H_FALSE@): Edit
28 to comment out unneeded lines.
29 (warn-on-use.h): Edit the recipe commands to work with DJGPP
30 without requiring a Unixy shell.
31
32 * inttypes.h (strtoimax) [DJGPP < 2.04]: New macro.
33
34 * sed2v2.inp (HAVE_ALLOCA, HAVE_DECL_STRTOLL, HAVE_DECL_STRTOIMAX)
35 (HAVE_STRTOLL, HAVE_SIGSET_T, HAVE_SNPRINTF): New edits.
36
12011-09-06 Paul Eggert <eggert@cs.ucla.edu> 372011-09-06 Paul Eggert <eggert@cs.ucla.edu>
2 38
3 * sedlibmk.inp (CONFIG_CLEAN_VPATH_FILES): Adjust to snippet moves 39 * sedlibmk.inp (CONFIG_CLEAN_VPATH_FILES): Adjust to snippet moves
diff --git a/msdos/inttypes.h b/msdos/inttypes.h
index e21f1b1055c..2c9b2b2cd11 100644
--- a/msdos/inttypes.h
+++ b/msdos/inttypes.h
@@ -30,6 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#else /* __DJGPP__ < 2.04 */ 30#else /* __DJGPP__ < 2.04 */
31#include <stdlib.h> 31#include <stdlib.h>
32#define strtoumax strtoull 32#define strtoumax strtoull
33#define strtoimax strtoll
33#endif /* __DJGPP__ < 2.04 */ 34#endif /* __DJGPP__ < 2.04 */
34 35
35#endif 36#endif
diff --git a/msdos/mainmake.v2 b/msdos/mainmake.v2
index 1aea06d2a4d..3b65fcc5ea4 100644
--- a/msdos/mainmake.v2
+++ b/msdos/mainmake.v2
@@ -64,12 +64,13 @@ MAKESHELL=/xyzzy/command
64top_srcdir := $(subst \,/,$(shell cd)) 64top_srcdir := $(subst \,/,$(shell cd))
65 65
66# Q: Do we need to bootstrap? 66# Q: Do we need to bootstrap?
67# A: Only if we find admin/admin.el, i.e. we are building out of 67# A: Only if we find autogen/README, i.e. we are building out of
68# a VCS-checkout (not a release) and src/b-emacs.exe does not exist. 68# a VCS-checkout (not a release), and src/b-emacs.exe does not exist.
69# This avoids building a bootstrap-emacs and recompiling Lisp files 69# This avoids building a bootstrap-emacs and recompiling Lisp files
70# when building a pretest/release tarball. 70# when building a pretest/release tarball. Recompiling Lisp files
71# is BAD because lisp/Makefile.in requires a Unixy shell.
71boot := 72boot :=
72ifneq ($(wildcard admin/admin.el),) 73ifneq ($(wildcard autogen/README),)
73ifeq ($(wildcard src/b-emacs.exe),) 74ifeq ($(wildcard src/b-emacs.exe),)
74boot := b-emacs.exe 75boot := b-emacs.exe
75endif 76endif
@@ -132,7 +133,6 @@ install: all
132 cd lib-src 133 cd lib-src
133 command.com /c >/dev/null for %p in (hexl etags ctags ebrowse) do\ 134 command.com /c >/dev/null for %p in (hexl etags ctags ebrowse) do\
134 if exist %p.exe mv -f %p.exe ../bin 135 if exist %p.exe mv -f %p.exe ../bin
135 if exist fns.el update fns.el ../bin/fns.el
136 cd .. 136 cd ..
137 cd src 137 cd src
138 mv -f emacs.exe ../bin/ 138 mv -f emacs.exe ../bin/
diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp
index 623f5cacbc9..d92fd1340ab 100644
--- a/msdos/sed1v2.inp
+++ b/msdos/sed1v2.inp
@@ -53,6 +53,7 @@ s/\.h\.in/.h-in/
53/^LIB_GCC *=/s/@LIB_GCC@// 53/^LIB_GCC *=/s/@LIB_GCC@//
54/^LIB_STANDARD *=/s/@LIB_STANDARD@// 54/^LIB_STANDARD *=/s/@LIB_STANDARD@//
55/^LIB_MATH *=/s/@LIB_MATH@/-lm/ 55/^LIB_MATH *=/s/@LIB_MATH@/-lm/
56/^LIB_PTHREAD *=/s/@LIB_PTHREAD@//
56/^LIBTIFF *=/s/@LIBTIFF@// 57/^LIBTIFF *=/s/@LIBTIFF@//
57/^LIBJPEG *=/s/@LIBJPEG@// 58/^LIBJPEG *=/s/@LIBJPEG@//
58/^LIBPNG *=/s/@LIBPNG@// 59/^LIBPNG *=/s/@LIBPNG@//
@@ -70,8 +71,8 @@ s/\.h\.in/.h-in/
70/^DBUS_CFLAGS *=/s/@DBUS_CFLAGS@// 71/^DBUS_CFLAGS *=/s/@DBUS_CFLAGS@//
71/^DBUS_LIBS *=/s/@DBUS_LIBS@// 72/^DBUS_LIBS *=/s/@DBUS_LIBS@//
72/^DBUS_OBJ *=/s/@DBUS_OBJ@// 73/^DBUS_OBJ *=/s/@DBUS_OBJ@//
73/^GCONF_CFLAGS *=/s/@GCONF_CFLAGS@// 74/^SETTINGS_CFLAGS *=/s/@SETTINGS_CFLAGS@//
74/^GCONF_LIBS *=/s/@GCONF_LIBS@// 75/^SETTINGS_LIBS *=/s/@SETTINGS_LIBS@//
75/^GTK_OBJ *=/s/@GTK_OBJ@// 76/^GTK_OBJ *=/s/@GTK_OBJ@//
76/^LIBS_TERMCAP *=/s/@LIBS_TERMCAP@// 77/^LIBS_TERMCAP *=/s/@LIBS_TERMCAP@//
77/^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/termcap.o tparam.o/ 78/^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/termcap.o tparam.o/
@@ -102,6 +103,7 @@ s/\.h\.in/.h-in/
102/^GNU_OBJC_CFLAGS*=/s/@GNU_OBJC_CFLAGS@// 103/^GNU_OBJC_CFLAGS*=/s/@GNU_OBJC_CFLAGS@//
103/^LIBRESOLV *=/s/@LIBRESOLV@// 104/^LIBRESOLV *=/s/@LIBRESOLV@//
104/^LIBSELINUX_LIBS *=/s/@LIBSELINUX_LIBS@// 105/^LIBSELINUX_LIBS *=/s/@LIBSELINUX_LIBS@//
106/^LIB_PTHREAD_SIGMASK *=/s/@[^@\n]*@//
105/^LIBGNUTLS_LIBS *=/s/@[^@\n]*@// 107/^LIBGNUTLS_LIBS *=/s/@[^@\n]*@//
106/^LIBGNUTLS_CFLAGS *=/s/@[^@\n]*@// 108/^LIBGNUTLS_CFLAGS *=/s/@[^@\n]*@//
107/^GETLOADAVG_LIBS *=/s/@[^@\n]*@// 109/^GETLOADAVG_LIBS *=/s/@[^@\n]*@//
diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp
index 3c3e69377f0..ea35a29c6b1 100644
--- a/msdos/sed2v2.inp
+++ b/msdos/sed2v2.inp
@@ -26,6 +26,7 @@
26#define NSIG 320\ 26#define NSIG 320\
27#endif 27#endif
28 28
29/^#undef HAVE_ALLOCA *$/s/^.*$/#define HAVE_ALLOCA 1/
29/^#undef HAVE_SETITIMER *$/s/^.*$/#define HAVE_SETITIMER 1/ 30/^#undef HAVE_SETITIMER *$/s/^.*$/#define HAVE_SETITIMER 1/
30/^#undef HAVE_STRUCT_UTIMBUF *$/s/^.*$/#define HAVE_STRUCT_UTIMBUF 1/ 31/^#undef HAVE_STRUCT_UTIMBUF *$/s/^.*$/#define HAVE_STRUCT_UTIMBUF 1/
31/^#undef LOCALTIME_CACHE *$/s/^.*$/#define LOCALTIME_CACHE 1/ 32/^#undef LOCALTIME_CACHE *$/s/^.*$/#define LOCALTIME_CACHE 1/
@@ -100,10 +101,19 @@ s/^#undef POINTER_TYPE *$/#define POINTER_TYPE void/
100#else\ 101#else\
101#undef HAVE_STDINT_H\ 102#undef HAVE_STDINT_H\
102#endif 103#endif
104s/^#undef HAVE_DECL_STRTOLL *$/#define HAVE_DECL_STRTOLL 1/
103s/^#undef HAVE_DECL_STRTOULL *$/#define HAVE_DECL_STRTOULL 1/ 105s/^#undef HAVE_DECL_STRTOULL *$/#define HAVE_DECL_STRTOULL 1/
106s/^#undef HAVE_DECL_STRTOIMAX *$/#define HAVE_DECL_STRTOIMAX 1/
104s/^#undef HAVE_DECL_STRTOUMAX *$/#define HAVE_DECL_STRTOUMAX 1/ 107s/^#undef HAVE_DECL_STRTOUMAX *$/#define HAVE_DECL_STRTOUMAX 1/
108s/^#undef HAVE_STRTOLL *$/#define HAVE_STRTOLL 1/
105s/^#undef HAVE_STRTOULL *$/#define HAVE_STRTOULL 1/ 109s/^#undef HAVE_STRTOULL *$/#define HAVE_STRTOULL 1/
106s/^#undef HAVE_STRTOULL *$/#define HAVE_STRTOULL 1/ 110/^#undef HAVE_SIGSET_T *$/s/^.*$/#define HAVE_SIGSET_T 1/
111/^#undef HAVE_SNPRINTF/c\
112#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 3\
113#define HAVE_SNPRINTF 1\
114#else\
115#undef HAVE_SNPRINTF\
116#endif
107 117
108# Comment out any remaining undef directives, because some of them 118# Comment out any remaining undef directives, because some of them
109# might be defined in sys/config.h we include at the top of config.h. 119# might be defined in sys/config.h we include at the top of config.h.
diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp
index a97ec7cb5f6..fdb8f8887db 100644
--- a/msdos/sedlibmk.inp
+++ b/msdos/sedlibmk.inp
@@ -111,6 +111,8 @@ am__cd = cd
111/^ALLOCA *=/s/@[^@\n]*@// 111/^ALLOCA *=/s/@[^@\n]*@//
112/^ALSA_CFLAGS *=/s/@[^@\n]*@// 112/^ALSA_CFLAGS *=/s/@[^@\n]*@//
113/^ALSA_LIBS *=/s/@[^@\n]*@// 113/^ALSA_LIBS *=/s/@[^@\n]*@//
114/^AR *=/s/@[^@\n]*@/ar/
115/^ARFLAGS *=/s/@[^@\n]*@/cru/
114/^AWK *=/s/@[^@\n]*@/gawk/ 116/^AWK *=/s/@[^@\n]*@/gawk/
115/^CANNOT_DUMP *=/s/@[^@\n]*@/no/ 117/^CANNOT_DUMP *=/s/@[^@\n]*@/no/
116/^CC *=/s/@[^@\n]*@/gcc/ 118/^CC *=/s/@[^@\n]*@/gcc/
@@ -147,9 +149,11 @@ am__cd = cd
147/^GNULIB_ATOLL *=/s/@GNULIB_ATOLL@/1/ 149/^GNULIB_ATOLL *=/s/@GNULIB_ATOLL@/1/
148/^GNULIB_CALLOC_POSIX *=/s/@GNULIB_CALLOC_POSIX@/0/ 150/^GNULIB_CALLOC_POSIX *=/s/@GNULIB_CALLOC_POSIX@/0/
149/^GNULIB_CANONICALIZE_FILE_NAME *=/s/@GNULIB_CANONICALIZE_FILE_NAME@/0/ 151/^GNULIB_CANONICALIZE_FILE_NAME *=/s/@GNULIB_CANONICALIZE_FILE_NAME@/0/
152/^GNULIB_CHDIR *=/s/@GNULIB_CHDIR@/0/
150/^GNULIB_CHOWN *=/s/@GNULIB_CHOWN@/0/ 153/^GNULIB_CHOWN *=/s/@GNULIB_CHOWN@/0/
151/^GNULIB_CLOSE *=/s/@GNULIB_CLOSE@/0/ 154/^GNULIB_CLOSE *=/s/@GNULIB_CLOSE@/0/
152/^GNULIB_DPRINTF *=/s/@GNULIB_DPRINTF@/0/ 155/^GNULIB_DPRINTF *=/s/@GNULIB_DPRINTF@/0/
156/^GNULIB_DUP *=/s/@GNULIB_DUP@/0/
153/^GNULIB_DUP2 *=/s/@GNULIB_DUP2@/0/ 157/^GNULIB_DUP2 *=/s/@GNULIB_DUP2@/0/
154/^GNULIB_DUP3 *=/s/@GNULIB_DUP3@/1/ 158/^GNULIB_DUP3 *=/s/@GNULIB_DUP3@/1/
155/^GNULIB_ENVIRON *=/s/@GNULIB_ENVIRON@/0/ 159/^GNULIB_ENVIRON *=/s/@GNULIB_ENVIRON@/0/
@@ -159,6 +163,8 @@ am__cd = cd
159/^GNULIB_FCHOWNAT *=/s/@GNULIB_FCHOWNAT@/0/ 163/^GNULIB_FCHOWNAT *=/s/@GNULIB_FCHOWNAT@/0/
160/^GNULIB_FCHMODAT *=/s/@GNULIB_FCHMODAT@/0/ 164/^GNULIB_FCHMODAT *=/s/@GNULIB_FCHMODAT@/0/
161/^GNULIB_FCLOSE *=/s/@GNULIB_FCLOSE@/0/ 165/^GNULIB_FCLOSE *=/s/@GNULIB_FCLOSE@/0/
166/^GNULIB_FDATASYNC *=/s/@GNULIB_FDATASYNC@/0/
167/^GNULIB_FDOPEN *=/s/@GNULIB_FDOPEN@/0/
162/^GNULIB_FFLUSH *=/s/@GNULIB_FFLUSH@/0/ 168/^GNULIB_FFLUSH *=/s/@GNULIB_FFLUSH@/0/
163/^GNULIB_FGETC *=/s/@GNULIB_FGETC@/0/ 169/^GNULIB_FGETC *=/s/@GNULIB_FGETC@/0/
164/^GNULIB_FGETS *=/s/@GNULIB_FGETS@/0/ 170/^GNULIB_FGETS *=/s/@GNULIB_FGETS@/0/
@@ -173,6 +179,7 @@ am__cd = cd
173/^GNULIB_FSCANF *=/s/@GNULIB_FSCANF@/0/ 179/^GNULIB_FSCANF *=/s/@GNULIB_FSCANF@/0/
174/^GNULIB_FSEEK *=/s/@GNULIB_FSEEK@/0/ 180/^GNULIB_FSEEK *=/s/@GNULIB_FSEEK@/0/
175/^GNULIB_FSEEKO *=/s/@GNULIB_FSEEKO@/0/ 181/^GNULIB_FSEEKO *=/s/@GNULIB_FSEEKO@/0/
182/^GNULIB_FSTAT *=/s/@GNULIB_FSTAT@/0/
176/^GNULIB_FSTATAT *=/s/@GNULIB_FSTATAT@/0/ 183/^GNULIB_FSTATAT *=/s/@GNULIB_FSTATAT@/0/
177/^GNULIB_FSYNC *=/s/@GNULIB_FSYNC@/0/ 184/^GNULIB_FSYNC *=/s/@GNULIB_FSYNC@/0/
178/^GNULIB_FTELL *=/s/@GNULIB_FTELL@/0/ 185/^GNULIB_FTELL *=/s/@GNULIB_FTELL@/0/
@@ -220,6 +227,7 @@ am__cd = cd
220/^GNULIB_NANOSLEEP *=/s/@GNULIB_NANOSLEEP@/0/ 227/^GNULIB_NANOSLEEP *=/s/@GNULIB_NANOSLEEP@/0/
221/^GNULIB_OBSTACK_PRINTF *=/s/@GNULIB_OBSTACK_PRINTF@/0/ 228/^GNULIB_OBSTACK_PRINTF *=/s/@GNULIB_OBSTACK_PRINTF@/0/
222/^GNULIB_OBSTACK_PRINTF_POSIX *=/s/@GNULIB_OBSTACK_PRINTF_POSIX@/0/ 229/^GNULIB_OBSTACK_PRINTF_POSIX *=/s/@GNULIB_OBSTACK_PRINTF_POSIX@/0/
230/^GNULIB_PCLOSE *=/s/@GNULIB_PCLOSE@/0/
223/^GNULIB_PERROR *=/s/@GNULIB_PERROR@/0/ 231/^GNULIB_PERROR *=/s/@GNULIB_PERROR@/0/
224/^GNULIB_PIPE *=/s/@GNULIB_PIPE@/0/ 232/^GNULIB_PIPE *=/s/@GNULIB_PIPE@/0/
225/^GNULIB_PIPE2 *=/s/@GNULIB_PIPE2@/0/ 233/^GNULIB_PIPE2 *=/s/@GNULIB_PIPE2@/0/
@@ -227,12 +235,14 @@ am__cd = cd
227/^GNULIB_PREAD *=/s/@GNULIB_PREAD@/0/ 235/^GNULIB_PREAD *=/s/@GNULIB_PREAD@/0/
228/^GNULIB_PRINTF *=/s/@GNULIB_PRINTF@/0/ 236/^GNULIB_PRINTF *=/s/@GNULIB_PRINTF@/0/
229/^GNULIB_PRINTF_POSIX *=/s/@GNULIB_PRINTF_POSIX@/0/ 237/^GNULIB_PRINTF_POSIX *=/s/@GNULIB_PRINTF_POSIX@/0/
238/^GNULIB_PTHREAD_SIGMASK *=/s/@GNULIB_PTHREAD_SIGMASK@/0/
230/^GNULIB_PTSNAME *=/s/@GNULIB_PTSNAME@/0/ 239/^GNULIB_PTSNAME *=/s/@GNULIB_PTSNAME@/0/
231/^GNULIB_PUTC *=/s/@GNULIB_PUTC@/0/ 240/^GNULIB_PUTC *=/s/@GNULIB_PUTC@/0/
232/^GNULIB_PUTCHAR *=/s/@GNULIB_PUTCHAR@/0/ 241/^GNULIB_PUTCHAR *=/s/@GNULIB_PUTCHAR@/0/
233/^GNULIB_PUTENV *=/s/@GNULIB_PUTENV@/0/ 242/^GNULIB_PUTENV *=/s/@GNULIB_PUTENV@/0/
234/^GNULIB_PUTS *=/s/@GNULIB_PUTS@/0/ 243/^GNULIB_PUTS *=/s/@GNULIB_PUTS@/0/
235/^GNULIB_PWRITE *=/s/@GNULIB_PWRITE@/0/ 244/^GNULIB_PWRITE *=/s/@GNULIB_PWRITE@/0/
245/^GNULIB_RAISE *=/s/@GNULIB_RAISE@/0/
236/^GNULIB_RANDOM_R *=/s/@GNULIB_RANDOM_R@/0/ 246/^GNULIB_RANDOM_R *=/s/@GNULIB_RANDOM_R@/0/
237/^GNULIB_READ *=/s/@GNULIB_READ@/0/ 247/^GNULIB_READ *=/s/@GNULIB_READ@/0/
238/^GNULIB_READLINK *=/s/@GNULIB_READLINK@/0/ 248/^GNULIB_READLINK *=/s/@GNULIB_READLINK@/0/
@@ -246,6 +256,9 @@ am__cd = cd
246/^GNULIB_RPMATCH *=/s/@GNULIB_RPMATCH@/0/ 256/^GNULIB_RPMATCH *=/s/@GNULIB_RPMATCH@/0/
247/^GNULIB_SCANF *=/s/@GNULIB_SCANF@/0/ 257/^GNULIB_SCANF *=/s/@GNULIB_SCANF@/0/
248/^GNULIB_SETENV *=/s/@GNULIB_SETENV@/0/ 258/^GNULIB_SETENV *=/s/@GNULIB_SETENV@/0/
259/^GNULIB_SIGACTION *=/s/@GNULIB_SIGACTION@/0/
260/^GNULIB_SIGNAL_H_SIGPIPE *=/s/@GNULIB_SIGNAL_H_SIGPIPE@/0/
261/^GNULIB_SIGPROCMASK *=/s/@GNULIB_SIGPROCMASK@/0/
249/^GNULIB_SLEEP *=/s/@GNULIB_SLEEP@/0/ 262/^GNULIB_SLEEP *=/s/@GNULIB_SLEEP@/0/
250/^GNULIB_SNPRINTF *=/s/@GNULIB_SNPRINTF@/0/ 263/^GNULIB_SNPRINTF *=/s/@GNULIB_SNPRINTF@/0/
251/^GNULIB_SPRINTF_POSIX *=/s/@GNULIB_SPRINTF_POSIX@/0/ 264/^GNULIB_SPRINTF_POSIX *=/s/@GNULIB_SPRINTF_POSIX@/0/
@@ -285,11 +298,14 @@ am__cd = cd
285/^GNULIB_WCTOMB *=/s/@GNULIB_WCTOMB@/0/ 298/^GNULIB_WCTOMB *=/s/@GNULIB_WCTOMB@/0/
286/^GNULIB_WRITE *=/s/@GNULIB_WRITE@/0/ 299/^GNULIB_WRITE *=/s/@GNULIB_WRITE@/0/
287/^GNULIB__EXIT *=/s/@GNULIB__EXIT@/0/ 300/^GNULIB__EXIT *=/s/@GNULIB__EXIT@/0/
301/^GSETTINGS_CFLAGS *=/s/@[^@\n]*@//
302/^GSETTINGS_LIBS *=/s/@[^@\n]*@//
288/^HAVE_ATOLL *=/s/@HAVE_ATOLL@/0/ 303/^HAVE_ATOLL *=/s/@HAVE_ATOLL@/0/
289/^HAVE_CANONICALIZE_FILE_NAME *=/s/@HAVE_CANONICALIZE_FILE_NAME@/0/ 304/^HAVE_CANONICALIZE_FILE_NAME *=/s/@HAVE_CANONICALIZE_FILE_NAME@/0/
290/^HAVE_CHOWN *=/s/@HAVE_CHOWN@/1/ 305/^HAVE_CHOWN *=/s/@HAVE_CHOWN@/1/
291/^HAVE_DECL_ENVIRON *=/s/@HAVE_DECL_ENVIRON@/1/ 306/^HAVE_DECL_ENVIRON *=/s/@HAVE_DECL_ENVIRON@/1/
292/^HAVE_DECL_FCHDIR *=/s/@HAVE_DECL_FCHDIR@/0/ 307/^HAVE_DECL_FCHDIR *=/s/@HAVE_DECL_FCHDIR@/0/
308/^HAVE_DECL_FDATASYNC *=/s/@HAVE_DECL_FDATASYNC@/0/
293/^HAVE_DECL_FPURGE *=/s/@HAVE_DECL_FPURGE@// 309/^HAVE_DECL_FPURGE *=/s/@HAVE_DECL_FPURGE@//
294/^HAVE_DECL_FSEEKO *=/s/@HAVE_DECL_FSEEKO@/0/ 310/^HAVE_DECL_FSEEKO *=/s/@HAVE_DECL_FSEEKO@/0/
295/^HAVE_DECL_FTELLO *=/s/@HAVE_DECL_FTELLO@/0/ 311/^HAVE_DECL_FTELLO *=/s/@HAVE_DECL_FTELLO@/0/
@@ -315,6 +331,7 @@ am__cd = cd
315/^HAVE_FCHDIR *=/s/@HAVE_FCHDIR@/0/ 331/^HAVE_FCHDIR *=/s/@HAVE_FCHDIR@/0/
316/^HAVE_FCHMODAT *=/s/@HAVE_FCHMODAT@/0/ 332/^HAVE_FCHMODAT *=/s/@HAVE_FCHMODAT@/0/
317/^HAVE_FCHOWNAT *=/s/@HAVE_FCHOWNAT@/0/ 333/^HAVE_FCHOWNAT *=/s/@HAVE_FCHOWNAT@/0/
334/^HAVE_FDATASYNC *=/s/@HAVE_FDATASYNC@/0/
318/^HAVE_FSEEKO *=/s/@HAVE_FSEEKO@/0/ 335/^HAVE_FSEEKO *=/s/@HAVE_FSEEKO@/0/
319/^HAVE_FSTATAT *=/s/@HAVE_FSTATAT@/0/ 336/^HAVE_FSTATAT *=/s/@HAVE_FSTATAT@/0/
320/^HAVE_FSYNC *=/s/@HAVE_FSYNC@/1/ 337/^HAVE_FSYNC *=/s/@HAVE_FSYNC@/1/
@@ -351,11 +368,16 @@ am__cd = cd
351/^HAVE_NANOSLEEP *=/s/@HAVE_NANOSLEEP@/0/ 368/^HAVE_NANOSLEEP *=/s/@HAVE_NANOSLEEP@/0/
352/^HAVE_OS_H *=/s/@HAVE_OS_H@/0/ 369/^HAVE_OS_H *=/s/@HAVE_OS_H@/0/
353/^HAVE_PIPE *=/s/@HAVE_PIPE@/0/ 370/^HAVE_PIPE *=/s/@HAVE_PIPE@/0/
371/^HAVE_PCLOSE *=/s/@HAVE_PCLOSE@/1/
354/^HAVE_PIPE2 *=/s/@HAVE_PIPE2@/0/ 372/^HAVE_PIPE2 *=/s/@HAVE_PIPE2@/0/
373/^HAVE_POPEN *=/s/@HAVE_POPEN@/1/
374/^HAVE_POSIX_SIGNALBLOCKING *=/s/@HAVE_POSIX_SIGNALBLOCKING@/1/
355/^HAVE_PREAD *=/s/@HAVE_PREAD@/0/ 375/^HAVE_PREAD *=/s/@HAVE_PREAD@/0/
356/^HAVE_PTSNAME *=/s/@HAVE_PTSNAME@/0/ 376/^HAVE_PTSNAME *=/s/@HAVE_PTSNAME@/0/
377/^HAVE_PTHREAD_SIGMASK *=/s/@HAVE_PTHREAD_SIGMASK@/0/
357/^HAVE_PWRITE *=/s/@HAVE_PWRITE@/0/ 378/^HAVE_PWRITE *=/s/@HAVE_PWRITE@/0/
358/^HAVE_RANDOM_H *=/s/@HAVE_RANDOM_H@/1/ 379/^HAVE_RANDOM_H *=/s/@HAVE_RANDOM_H@/1/
380/^HAVE_RAISE *=/s/@HAVE_RAISE@/1/
359/^HAVE_RANDOM_R *=/s/@HAVE_RANDOM_R@/0/ 381/^HAVE_RANDOM_R *=/s/@HAVE_RANDOM_R@/0/
360/^HAVE_READLINK *=/s/@HAVE_READLINK@/0/ 382/^HAVE_READLINK *=/s/@HAVE_READLINK@/0/
361/^HAVE_READLINKAT *=/s/@HAVE_READLINKAT@/0/ 383/^HAVE_READLINKAT *=/s/@HAVE_READLINKAT@/0/
@@ -363,15 +385,20 @@ am__cd = cd
363/^HAVE_RENAMEAT *=/s/@HAVE_RENAMEAT@/0/ 385/^HAVE_RENAMEAT *=/s/@HAVE_RENAMEAT@/0/
364/^HAVE_RPMATCH *=/s/@HAVE_RPMATCH@/0/ 386/^HAVE_RPMATCH *=/s/@HAVE_RPMATCH@/0/
365/^HAVE_SETENV *=/s/@HAVE_SETENV@/1/ 387/^HAVE_SETENV *=/s/@HAVE_SETENV@/1/
388/^HAVE_SIGACTION *=/s/@HAVE_SIGACTION@/1/
389/^HAVE_SIGHANDLER_T *=/s/@HAVE_SIGHANDLER_T@/0/
390/^HAVE_SIGINFO_T *=/s/@HAVE_SIGINFO_T@/0/
366/^HAVE_SIGNED_SIG_ATOMIC_T *=/s/@HAVE_SIGNED_SIG_ATOMIC_T@/1/ 391/^HAVE_SIGNED_SIG_ATOMIC_T *=/s/@HAVE_SIGNED_SIG_ATOMIC_T@/1/
367/^HAVE_SIGNED_WCHAR_T *=/s/@HAVE_SIGNED_WCHAR_T@/0/ 392/^HAVE_SIGNED_WCHAR_T *=/s/@HAVE_SIGNED_WCHAR_T@/0/
368/^HAVE_SIGNED_WINT_T *=/s/@HAVE_SIGNED_WINT_T@/1/ 393/^HAVE_SIGNED_WINT_T *=/s/@HAVE_SIGNED_WINT_T@/1/
394/^HAVE_SIGSET_T *=/s/@HAVE_SIGSET_T@/1/
369/^HAVE_SLEEP *=/s/@HAVE_SLEEP@/1/ 395/^HAVE_SLEEP *=/s/@HAVE_SLEEP@/1/
370/^HAVE_STDINT_H *=/s/@HAVE_STDINT_H@/HAVE_STDINT_H/ 396/^HAVE_STDINT_H *=/s/@HAVE_STDINT_H@/HAVE_STDINT_H/
371/^HAVE_STRPTIME *=/s/@HAVE_STRPTIME@/0/ 397/^HAVE_STRPTIME *=/s/@HAVE_STRPTIME@/0/
372/^HAVE_STRTOD *=/s/@HAVE_STRTOD@/1/ 398/^HAVE_STRTOD *=/s/@HAVE_STRTOD@/1/
373/^HAVE_STRTOLL *=/s/@HAVE_STRTOLL@/1/ 399/^HAVE_STRTOLL *=/s/@HAVE_STRTOLL@/1/
374/^HAVE_STRTOULL *=/s/@HAVE_STRTOULL@/1/ 400/^HAVE_STRTOULL *=/s/@HAVE_STRTOULL@/1/
401/^HAVE_STRUCT_SIGACTION_SA_SIGACTION *=/s/@HAVE_STRUCT_SIGACTION_SA_SIGACTION@/0/
375/^HAVE_STRUCT_RANDOM_DATA *=/s/@HAVE_STRUCT_RANDOM_DATA@/0/ 402/^HAVE_STRUCT_RANDOM_DATA *=/s/@HAVE_STRUCT_RANDOM_DATA@/0/
376/^HAVE_SYMLINK *=/s/@HAVE_SYMLINK@/1/ 403/^HAVE_SYMLINK *=/s/@HAVE_SYMLINK@/1/
377/^HAVE_SYMLINKAT *=/s/@HAVE_SYMLINKAT@/0/ 404/^HAVE_SYMLINKAT *=/s/@HAVE_SYMLINKAT@/0/
@@ -381,6 +408,7 @@ am__cd = cd
381/^HAVE_SYS_PARAM_H *=/s/@HAVE_SYS_PARAM_H@/1/ 408/^HAVE_SYS_PARAM_H *=/s/@HAVE_SYS_PARAM_H@/1/
382/^HAVE_SYS_TYPES_H *=/s/@HAVE_SYS_TYPES_H@/1/ 409/^HAVE_SYS_TYPES_H *=/s/@HAVE_SYS_TYPES_H@/1/
383/^HAVE_TIMEGM *=/s/@HAVE_TIMEGM@/0/ 410/^HAVE_TIMEGM *=/s/@HAVE_TIMEGM@/0/
411/^HAVE_TYPE_VOLATILE_SIG_ATOMIC_T *=/s/@HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@/1/
384/^HAVE_UNISTD_H *=/s/@HAVE_UNISTD_H@/1/ 412/^HAVE_UNISTD_H *=/s/@HAVE_UNISTD_H@/1/
385/^HAVE_UNLINKAT *=/s/@HAVE_UNLINKAT@/0/ 413/^HAVE_UNLINKAT *=/s/@HAVE_UNLINKAT@/0/
386/^HAVE_UNLOCKPT *=/s/@HAVE_UNLOCKPT@/0/ 414/^HAVE_UNLOCKPT *=/s/@HAVE_UNLOCKPT@/0/
@@ -398,11 +426,14 @@ am__cd = cd
398/^INCLUDE_NEXT_AS_FIRST_DIRECTIVE *=/s/@[^@\n]*@/include_next/ 426/^INCLUDE_NEXT_AS_FIRST_DIRECTIVE *=/s/@[^@\n]*@/include_next/
399/^LDFLAGS *=/s/@[^@\n]*@// 427/^LDFLAGS *=/s/@[^@\n]*@//
400/^LD_FIRSTFLAG *=/s/@[^@\n]*@// 428/^LD_FIRSTFLAG *=/s/@[^@\n]*@//
429/^LIB_PTHREAD *=/s/@[^@\n]*@//
430/^LIB_PTHREAD_SIGMASK *=/s/@[^@\n]*@//
401/^LIBS *=/s/@[^@\n]*@// 431/^LIBS *=/s/@[^@\n]*@//
402/^MAKEINFO *=/s/@MAKEINFO@/makeinfo/ 432/^MAKEINFO *=/s/@MAKEINFO@/makeinfo/
403# MKDIR_P lines are edited further below 433# MKDIR_P lines are edited further below
404/^MKDIR_P *=/s/@MKDIR_P@// 434/^MKDIR_P *=/s/@MKDIR_P@//
405/^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/ 435/^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/
436/^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H *=/s/@[^@\n]*@/<signal.h>/
406/^NEXT_AS_FIRST_DIRECTIVE_STDARG_H *=/s/@[^@\n]*@// 437/^NEXT_AS_FIRST_DIRECTIVE_STDARG_H *=/s/@[^@\n]*@//
407/^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@// 438/^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@//
408/^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/ 439/^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
@@ -413,6 +444,7 @@ am__cd = cd
413/^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H *=/s/@[^@\n]*@/<unistd.h>/ 444/^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H *=/s/@[^@\n]*@/<unistd.h>/
414/^NEXT_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/ 445/^NEXT_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/
415/^NEXT_STDARG_H *=/s/@[^@\n]*@// 446/^NEXT_STDARG_H *=/s/@[^@\n]*@//
447/^NEXT_SIGNAL_H *=/s/@[^@\n]*@/<signal.h>/
416/^NEXT_STDDEF_H *=/s/@[^@\n]*@// 448/^NEXT_STDDEF_H *=/s/@[^@\n]*@//
417/^NEXT_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/ 449/^NEXT_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/
418/^NEXT_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/ 450/^NEXT_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
@@ -435,6 +467,7 @@ am__cd = cd
435/^REPLACE_DUP2 *=/s/@REPLACE_DUP2@/0/ 467/^REPLACE_DUP2 *=/s/@REPLACE_DUP2@/0/
436/^REPLACE_FCHOWNAT *=/s/@REPLACE_FCHOWNAT@/0/ 468/^REPLACE_FCHOWNAT *=/s/@REPLACE_FCHOWNAT@/0/
437/^REPLACE_FCLOSE *=/s/@REPLACE_FCLOSE@/0/ 469/^REPLACE_FCLOSE *=/s/@REPLACE_FCLOSE@/0/
470/^REPLACE_FDOPEN *=/s/@REPLACE_FDOPEN@/0/
438/^REPLACE_FFLUSH *=/s/@REPLACE_FFLUSH@/0/ 471/^REPLACE_FFLUSH *=/s/@REPLACE_FFLUSH@/0/
439/^REPLACE_FOPEN *=/s/@REPLACE_FOPEN@/0/ 472/^REPLACE_FOPEN *=/s/@REPLACE_FOPEN@/0/
440/^REPLACE_FPRINTF *=/s/@REPLACE_FPRINTF@/0/ 473/^REPLACE_FPRINTF *=/s/@REPLACE_FPRINTF@/0/
@@ -473,9 +506,11 @@ am__cd = cd
473/^REPLACE_POPEN *=/s/@REPLACE_POPEN@/0/ 506/^REPLACE_POPEN *=/s/@REPLACE_POPEN@/0/
474/^REPLACE_PREAD *=/s/@REPLACE_PREAD@/0/ 507/^REPLACE_PREAD *=/s/@REPLACE_PREAD@/0/
475/^REPLACE_PRINTF *=/s/@REPLACE_PRINTF@/0/ 508/^REPLACE_PRINTF *=/s/@REPLACE_PRINTF@/0/
509/^REPLACE_PTHREAD_SIGMASK *=/s/@REPLACE_PTHREAD_SIGMASK@/0/
476/^REPLACE_PUTENV *=/s/@REPLACE_PUTENV@/0/ 510/^REPLACE_PUTENV *=/s/@REPLACE_PUTENV@/0/
477/^REPLACE_PWRITE *=/s/@REPLACE_PWRITE@/0/ 511/^REPLACE_PWRITE *=/s/@REPLACE_PWRITE@/0/
478/^REPLACE_READ *=/s/@REPLACE_READ@/0/ 512/^REPLACE_READ *=/s/@REPLACE_READ@/0/
513/^REPLACE_RAISE *=/s/@REPLACE_RAISE@/0/
479/^REPLACE_READLINK *=/s/@REPLACE_READLINK@/0/ 514/^REPLACE_READLINK *=/s/@REPLACE_READLINK@/0/
480/^REPLACE_REALLOC *=/s/@REPLACE_REALLOC@/0/ 515/^REPLACE_REALLOC *=/s/@REPLACE_REALLOC@/0/
481/^REPLACE_REALPATH *=/s/@REPLACE_REALPATH@/0/ 516/^REPLACE_REALPATH *=/s/@REPLACE_REALPATH@/0/
@@ -510,6 +545,7 @@ am__cd = cd
510/^REPLACE_WRITE *=/s/@REPLACE_WRITE@/0/ 545/^REPLACE_WRITE *=/s/@REPLACE_WRITE@/0/
511/^SIG_ATOMIC_T_SUFFIX *=/s/@SIG_ATOMIC_T_SUFFIX@// 546/^SIG_ATOMIC_T_SUFFIX *=/s/@SIG_ATOMIC_T_SUFFIX@//
512/^SIZE_T_SUFFIX *=/s/@SIZE_T_SUFFIX@/u/ 547/^SIZE_T_SUFFIX *=/s/@SIZE_T_SUFFIX@/u/
548/^ALLOCA_H *=/s/@[^@\n]*@/alloca.h/
513/^STDBOOL_H *=/s/@[^@\n]*@// 549/^STDBOOL_H *=/s/@[^@\n]*@//
514/^STDARG_H *=/s/@[^@\n]*@// 550/^STDARG_H *=/s/@[^@\n]*@//
515/^STDDEF_H *=/s/@[^@\n]*@// 551/^STDDEF_H *=/s/@[^@\n]*@//
@@ -522,7 +558,7 @@ am__cd = cd
522/^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@// 558/^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@//
523/am__append_1 *=.*gettext\.h/s/@[^@\n]*@/\#/ 559/am__append_1 *=.*gettext\.h/s/@[^@\n]*@/\#/
524/am__append_2 *=.*verify\.h/s/@[^@\n]*@// 560/am__append_2 *=.*verify\.h/s/@[^@\n]*@//
525/^gl_LIBOBJS *=/s/@[^@\n]*@/getopt.o getopt1.o strftime.o time_r.o getloadavg.o md5.o filemode.o sha1.o/ 561/^gl_LIBOBJS *=/s/@[^@\n]*@/getopt.o getopt1.o strftime.o time_r.o getloadavg.o pthread_sigmask.o/
526/^BUILT_SOURCES *=/s/ *inttypes\.h// 562/^BUILT_SOURCES *=/s/ *inttypes\.h//
527/^am_libgnu_a_OBJECTS *=/s/careadlinkat\.\$(OBJEXT)// 563/^am_libgnu_a_OBJECTS *=/s/careadlinkat\.\$(OBJEXT)//
528/^am_libgnu_a_OBJECTS *=/s/allocator\.\$(OBJEXT)// 564/^am_libgnu_a_OBJECTS *=/s/allocator\.\$(OBJEXT)//
@@ -560,6 +596,8 @@ s/^ -*test -z.*|| rm/ -rm/
560s/@echo /@djecho/ 596s/@echo /@djecho/
561# 597#
562# Fix the recipes for header files 598# Fix the recipes for header files
599s/^@GL_GENERATE_ALLOCA_H_TRUE@//
600s/^@GL_GENERATE_ALLOCA_H_FALSE@/\#/
563s/^@GL_GENERATE_STDBOOL_H_TRUE@/\#/ 601s/^@GL_GENERATE_STDBOOL_H_TRUE@/\#/
564s/^@GL_GENERATE_STDBOOL_H_FALSE@// 602s/^@GL_GENERATE_STDBOOL_H_FALSE@//
565s/^@GL_GENERATE_STDARG_H_TRUE@/\#/ 603s/^@GL_GENERATE_STDARG_H_TRUE@/\#/
@@ -574,6 +612,9 @@ arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h\
574/^cxxdefs\.h:/,/^[ ][ ]*mv /c\ 612/^cxxdefs\.h:/,/^[ ][ ]*mv /c\
575cxxdefs.h: $(top_srcdir)/build-aux/snippet/cxxdefs.h\ 613cxxdefs.h: $(top_srcdir)/build-aux/snippet/cxxdefs.h\
576 sed -n -e '/_GL_CXXDEFS/,$$p' < $(top_srcdir)/build-aux/snippet/cxxdefs.h > $@ 614 sed -n -e '/_GL_CXXDEFS/,$$p' < $(top_srcdir)/build-aux/snippet/cxxdefs.h > $@
615/^warn-on-use\.h:/,/^[ ][ ]*mv /c\
616warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h\
617 sed -n -e '/^.ifndef/,$$p' < $(top_srcdir)/build-aux/snippet/warn-on-use.h > $@
577s/^ [ ]*{ echo \(.*\); \\/ djecho \1 > $@-t/ 618s/^ [ ]*{ echo \(.*\); \\/ djecho \1 > $@-t/
578s/^ [ ]*{ echo \(.*\) && \\/ djecho \1 > $@-t/ 619s/^ [ ]*{ echo \(.*\) && \\/ djecho \1 > $@-t/
579s/ \&\& \\ *$// 620s/ \&\& \\ *$//
diff --git a/src/ChangeLog b/src/ChangeLog
index 37f2e39848f..2cb49cace00 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,14 +1,4 @@
12011-09-29 Paul Eggert <eggert@cs.ucla.edu> 12011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * alloc.c: Do not assume sizeof (size_t) is a multiple of 8
4 when debugging.
5 (alignof, XMALLOC_BASE_ALIGNMENT, XMALLOC_HEADER_ALIGNMENT)
6 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
7 (XMALLOC_OVERRUN_CHECK_OVERHEAD, xmalloc_put_size, xmalloc_get_size)
8 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
9 Replace uses of sizeof (size_t) with XMALLOC_OVERRUN_SIZE_SIZE.
10
112011-09-28 Paul Eggert <eggert@cs.ucla.edu>
12 2
13 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp): 3 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
14 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE) 4 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
@@ -785,6 +775,57 @@
785 rather than rolling our own approximation. 775 rather than rolling our own approximation.
786 (SCROLL_BAR_VEC_SIZE): Remove; not used. 776 (SCROLL_BAR_VEC_SIZE): Remove; not used.
787 777
7782011-09-30 Paul Eggert <eggert@cs.ucla.edu>
779
780 Remove dependency on glibc malloc internals.
781 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
782 Move back here from lisp.h, but with their new implementations.
783 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
784 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
785 * charset.c (charset_table_init): New static var.
786 (syms_of_charset): Use it instead of xmalloc. This removes a
787 dependency on glibc malloc internals. See Eli Zaretskii's comment in
788 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
789 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
790 Move back to alloc.c.
791 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
792 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
793
7942011-09-30 Jan Djärv <jan.h.d@swipnet.se>
795
796 * nsterm.m (windowDidResize): Call x_set_window_size only when
797 ns_in_resize is true. Otherwise set pixelwidth/height and
798 call change_frame_size (Bug#9628).
799
8002011-09-30 Paul Eggert <eggert@cs.ucla.edu>
801
802 Port --enable-checking=all to Fedora 14 x86-64.
803 * charset.c (syms_of_charset): Also account for glibc malloc's
804 internal overhead when calculating the initial malloc maximum.
805
806 Port --enable-checking=all to Fedora 14 x86.
807 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
808 Move to lisp.h.
809 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
810 (overrun_check_realloc, overrun_check_free):
811 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
812 That way, xmalloc returns a properly-aligned pointer even if
813 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
814 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
815 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
816 into account when calculating the initial malloc maximum.
817 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
818 Move here from alloc.c, so that charset.c can use it too.
819 Properly align; the old code wasn't right for common 32-bit hosts
820 when configured with --enable-checking=all.
821 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
822 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
823
8242011-09-29 Eli Zaretskii <eliz@gnu.org>
825
826 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
827 use EDOM.
828
7882011-09-28 Eli Zaretskii <eliz@gnu.org> 8292011-09-28 Eli Zaretskii <eliz@gnu.org>
789 830
790 * xdisp.c (compute_display_string_end): If there's no display 831 * xdisp.c (compute_display_string_end): If there's no display
@@ -803,8 +844,8 @@
803 * xdisp.c (handle_invisible_prop): If invisible text ends on a 844 * xdisp.c (handle_invisible_prop): If invisible text ends on a
804 newline, reseat the iterator instead of bidi-iterating there one 845 newline, reseat the iterator instead of bidi-iterating there one
805 character at a time. (Bug#9610) 846 character at a time. (Bug#9610)
806 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past 847 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail out when
807 TO_CHARPOS if the bidi iterator is at base embedding level. 848 past TO_CHARPOS if the bidi iterator is at base embedding level.
808 849
8092011-09-27 Andreas Schwab <schwab@linux-m68k.org> 8502011-09-27 Andreas Schwab <schwab@linux-m68k.org>
810 851
@@ -841,9 +882,9 @@
841 value is now t. Doc fix. 882 value is now t. Doc fix.
842 883
843 * indent.c (Fvertical_motion): Compute and apply the overshoot 884 * indent.c (Fvertical_motion): Compute and apply the overshoot
844 logic when moving up, not only when moving down. Fix the 885 logic also when moving up, not only when moving down. Fix the
845 confusing name and values of the it_overshoot_expected variable; 886 confusing name and values of the it_overshoot_expected variable;
846 logic changes accordingly. (Bug#9254) (Bug#9549) 887 logic changed accordingly. (Bug#9254) (Bug#9549)
847 888
848 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when 889 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
849 CHARPOS is covered by a display string which includes newlines. 890 CHARPOS is covered by a display string which includes newlines.
@@ -859,7 +900,7 @@
859 900
8602011-09-24 Jim Meyering <meyering@redhat.com> 9012011-09-24 Jim Meyering <meyering@redhat.com>
861 902
862 do not ignore write error for any output size 903 Do not ignore write error for any output size.
863 The previous change was incomplete. 904 The previous change was incomplete.
864 While it makes emacs --batch detect the vast majority of stdout 905 While it makes emacs --batch detect the vast majority of stdout
865 write failures, errors were still ignored whenever the output size is 906 write failures, errors were still ignored whenever the output size is
diff --git a/src/alloc.c b/src/alloc.c
index 286421ebe47..bfb40e6c09a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -490,36 +490,45 @@ buffer_memory_full (ptrdiff_t nbytes)
490/* Check for overrun in malloc'ed buffers by wrapping a header and trailer 490/* Check for overrun in malloc'ed buffers by wrapping a header and trailer
491 around each block. 491 around each block.
492 492
493 The header consists of 16 fixed bytes followed by 493 The header consists of XMALLOC_OVERRUN_CHECK_SIZE fixed bytes
494 XMALLOC_OVERRUN_SIZE_SIZE bytes containing the original block size 494 followed by XMALLOC_OVERRUN_SIZE_SIZE bytes containing the original
495 in little-endian order. The trailer consists of 16 fixed bytes. 495 block size in little-endian order. The trailer consists of
496 XMALLOC_OVERRUN_CHECK_SIZE fixed bytes.
496 497
497 The header is used to detect whether this block has been allocated 498 The header is used to detect whether this block has been allocated
498 through these functions -- as it seems that some low-level libc 499 through these functions, as some low-level libc functions may
499 functions may bypass the malloc hooks. 500 bypass the malloc hooks. */
500*/
501
502 501
503#define XMALLOC_OVERRUN_CHECK_SIZE 16 502#define XMALLOC_OVERRUN_CHECK_SIZE 16
504#define XMALLOC_OVERRUN_CHECK_OVERHEAD \ 503#define XMALLOC_OVERRUN_CHECK_OVERHEAD \
505 (2 * XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE) 504 (2 * XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE)
506 505
507/* Define XMALLOC_OVERRUN_SIZE_SIZE so that (1) it's large enough to 506/* Define XMALLOC_OVERRUN_SIZE_SIZE so that (1) it's large enough to
508 hold a size_t value and (2) so that the header size is a multiple 507 hold a size_t value and (2) the header size is a multiple of the
509 of the alignment that Emacs needs. */ 508 alignment that Emacs needs for C types and for USE_LSB_TAG. */
510#define alignof(type) offsetof (struct { char c; type x; }, x) 509#define XMALLOC_BASE_ALIGNMENT \
511#define XMALLOC_BASE_ALIGNMENT \ 510 offsetof ( \
512 max (max (alignof (double), alignof (long double)), alignof (intmax_t)) 511 struct { \
512 union { long double d; intmax_t i; void *p; } u; \
513 char c; \
514 }, \
515 c)
513#ifdef USE_LSB_TAG 516#ifdef USE_LSB_TAG
514# define XMALLOC_HEADER_ALIGNMENT max (1 << GCTYPEBITS, XMALLOC_BASE_ALIGNMENT) 517/* A common multiple of the positive integers A and B. Ideally this
518 would be the least common multiple, but there's no way to do that
519 as a constant expression in C, so do the best that we can easily do. */
520# define COMMON_MULTIPLE(a, b) \
521 ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b))
522# define XMALLOC_HEADER_ALIGNMENT \
523 COMMON_MULTIPLE (1 << GCTYPEBITS, XMALLOC_BASE_ALIGNMENT)
515#else 524#else
516# define XMALLOC_HEADER_ALIGNMENT XMALLOC_BASE_ALIGNMENT 525# define XMALLOC_HEADER_ALIGNMENT XMALLOC_BASE_ALIGNMENT
517#endif 526#endif
518#define XMALLOC_OVERRUN_SIZE_SIZE \ 527#define XMALLOC_OVERRUN_SIZE_SIZE \
519 (((XMALLOC_OVERRUN_CHECK_SIZE + sizeof (size_t) \ 528 (((XMALLOC_OVERRUN_CHECK_SIZE + sizeof (size_t) \
520 + XMALLOC_HEADER_ALIGNMENT - 1) \ 529 + XMALLOC_HEADER_ALIGNMENT - 1) \
521 / XMALLOC_HEADER_ALIGNMENT * XMALLOC_HEADER_ALIGNMENT) \ 530 / XMALLOC_HEADER_ALIGNMENT * XMALLOC_HEADER_ALIGNMENT) \
522 - XMALLOC_OVERRUN_CHECK_SIZE) 531 - XMALLOC_OVERRUN_CHECK_SIZE)
523 532
524static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] = 533static char const xmalloc_overrun_check_header[XMALLOC_OVERRUN_CHECK_SIZE] =
525 { '\x9a', '\x9b', '\xae', '\xaf', 534 { '\x9a', '\x9b', '\xae', '\xaf',
diff --git a/src/charset.c b/src/charset.c
index 2451c55e92a..299655b2cf8 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1154,10 +1154,10 @@ usage: (define-charset-internal ...) */)
1154 sizeof *charset_table); 1154 sizeof *charset_table);
1155 memcpy (new_table, charset_table, old_size * sizeof *new_table); 1155 memcpy (new_table, charset_table, old_size * sizeof *new_table);
1156 charset_table = new_table; 1156 charset_table = new_table;
1157 /* FIXME: Doesn't this leak memory? The old charset_table becomes 1157 /* FIXME: This leaks memory, as the old charset_table becomes
1158 unreachable. It could be that this is intentional, because the 1158 unreachable. If the old charset table is charset_table_init
1159 old charset table may be in a dumped emacs, and reallocating such 1159 then this leak is intentional; otherwise, it's unclear.
1160 a table may not work. If the memory leak is intentional, a 1160 If the latter memory leak is intentional, a
1161 comment should be added to explain this. If not, the old 1161 comment should be added to explain this. If not, the old
1162 charset_table should be freed, by passing it as the 1st argument 1162 charset_table should be freed, by passing it as the 1st argument
1163 to xpalloc and removing the memcpy. */ 1163 to xpalloc and removing the memcpy. */
@@ -2318,20 +2318,21 @@ init_charset_once (void)
2318 2318
2319#ifdef emacs 2319#ifdef emacs
2320 2320
2321/* Allocate an initial charset table that is large enough to handle
2322 Emacs while it is bootstrapping. As of September 2011, the size
2323 needs to be at least 166; make it a bit bigger to allow for future
2324 expansion.
2325
2326 Don't make the value so small that the table is reallocated during
2327 bootstrapping, as glibc malloc calls larger than just under 64 KiB
2328 during an initial bootstrap wreak havoc after dumping; see the
2329 M_MMAP_THRESHOLD value in alloc.c, plus there is a extra overhead
2330 internal to glibc malloc and perhaps to Emacs malloc debugging. */
2331static struct charset charset_table_init[180];
2332
2321void 2333void
2322syms_of_charset (void) 2334syms_of_charset (void)
2323{ 2335{
2324 /* Allocate an initial charset table that is just under 64 KiB in size.
2325 This should be large enough so that the charset table need not be
2326 reallocated during an initial bootstrap. Allocating anything larger than
2327 64 KiB in an initial run may not work, because glibc malloc might use
2328 mmap for larger allocations, and these don't work well across dumped
2329 systems. */
2330 enum {
2331 initial_malloc_max = (1 << 16) - 1,
2332 charset_table_size_init = initial_malloc_max / sizeof (struct charset)
2333 };
2334
2335 DEFSYM (Qcharsetp, "charsetp"); 2336 DEFSYM (Qcharsetp, "charsetp");
2336 2337
2337 DEFSYM (Qascii, "ascii"); 2338 DEFSYM (Qascii, "ascii");
@@ -2364,9 +2365,8 @@ syms_of_charset (void)
2364 Vcharset_hash_table = Fmake_hash_table (2, args); 2365 Vcharset_hash_table = Fmake_hash_table (2, args);
2365 } 2366 }
2366 2367
2367 charset_table = (struct charset *) xmalloc (sizeof (struct charset) 2368 charset_table = charset_table_init;
2368 * charset_table_size_init); 2369 charset_table_size = sizeof charset_table_init / sizeof *charset_table_init;
2369 charset_table_size = charset_table_size_init;
2370 charset_table_used = 0; 2370 charset_table_used = 0;
2371 2371
2372 defsubr (&Scharsetp); 2372 defsubr (&Scharsetp);
diff --git a/src/nsterm.m b/src/nsterm.m
index 827404a2974..a2ae5e69512 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5357,7 +5357,23 @@ ns_term_shutdown (int sig)
5357 a "windowDidResize" which calls x_set_window_size). */ 5357 a "windowDidResize" which calls x_set_window_size). */
5358#ifndef NS_IMPL_GNUSTEP 5358#ifndef NS_IMPL_GNUSTEP
5359 if (cols > 0 && rows > 0) 5359 if (cols > 0 && rows > 0)
5360 x_set_window_size (emacsframe, 0, cols, rows); 5360 {
5361 if (ns_in_resize)
5362 x_set_window_size (emacsframe, 0, cols, rows);
5363 else
5364 {
5365 NSWindow *window = [self window];
5366 NSRect wr = [window frame];
5367 FRAME_PIXEL_WIDTH (emacsframe) = (int)wr.size.width
5368 - emacsframe->border_width;
5369 FRAME_PIXEL_HEIGHT (emacsframe) = (int)wr.size.height
5370 - FRAME_NS_TITLEBAR_HEIGHT (emacsframe)
5371 - FRAME_TOOLBAR_HEIGHT (emacsframe);
5372 change_frame_size (emacsframe, rows, cols, 0, 0, 1);
5373 SET_FRAME_GARBAGED (emacsframe);
5374 cancel_mouse_face (emacsframe);
5375 }
5376 }
5361#endif 5377#endif
5362 5378
5363 ns_send_appdefined (-1); 5379 ns_send_appdefined (-1);
diff --git a/src/sysdep.c b/src/sysdep.c
index ba296a2d094..d2ce5a8cc1b 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1844,7 +1844,11 @@ snprintf (char *buf, size_t bufsize, char const *format, ...)
1844 1844
1845 if (INT_MAX < nbytes) 1845 if (INT_MAX < nbytes)
1846 { 1846 {
1847#ifdef EOVERFLOW
1847 errno = EOVERFLOW; 1848 errno = EOVERFLOW;
1849#else
1850 errno = EDOM;
1851#endif
1848 return -1; 1852 return -1;
1849 } 1853 }
1850 return nbytes; 1854 return nbytes;