aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2010-04-02 11:45:27 +0200
committerJan Djärv2010-04-02 11:45:27 +0200
commit7a5a264fc27bde6870f08ecc5d85eddc36fa0336 (patch)
tree54106d60bd5f2273821bb5e3fb73bebf31a5599e
parentd0b228766f1471ed104d2e038f63cd4627d79b57 (diff)
parent9cb52861f287cbad4608a5fceddae5bac1a90ba6 (diff)
downloademacs-7a5a264fc27bde6870f08ecc5d85eddc36fa0336.tar.gz
emacs-7a5a264fc27bde6870f08ecc5d85eddc36fa0336.zip
Merge from trunk
-rw-r--r--ChangeLog4
-rw-r--r--admin/CPP-DEFINES5
-rw-r--r--admin/ChangeLog4
-rwxr-xr-xconfigure5
-rw-r--r--configure.in5
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/gnus.texi9
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/emacsclient.c1
-rw-r--r--lib-src/etags.c3
-rw-r--r--lib-src/movemail.c3
-rw-r--r--msdos/ChangeLog9
-rw-r--r--msdos/mainmake96
-rw-r--r--msdos/sed1.inp57
-rw-r--r--msdos/sed2.inp56
-rw-r--r--msdos/sed3.inp54
-rw-r--r--src/ChangeLog63
-rw-r--r--src/Makefile.in13
-rw-r--r--src/buffer.c6
-rw-r--r--src/callproc.c5
-rw-r--r--src/dired.c4
-rw-r--r--src/dispnew.c3
-rw-r--r--src/dosfns.c7
-rw-r--r--src/ecrt0.c4
-rw-r--r--src/emacs.c9
-rw-r--r--src/fileio.c27
-rw-r--r--src/filelock.c3
-rw-r--r--src/floatfns.c4
-rw-r--r--src/gmalloc.c10
-rw-r--r--src/keyboard.c4
-rw-r--r--src/lread.c7
-rw-r--r--src/msdos.c458
-rw-r--r--src/process.c4
-rw-r--r--src/s/msdos.h50
-rw-r--r--src/s/netbsd.h2
-rw-r--r--src/sysdep.c18
-rw-r--r--src/unexaix.c1
-rw-r--r--src/unexec.c11
-rw-r--r--src/w16select.c21
-rw-r--r--src/w32term.c4
-rw-r--r--src/xdisp.c33
-rw-r--r--src/xrdb.c3
-rw-r--r--src/xterm.c2
43 files changed, 149 insertions, 950 deletions
diff --git a/ChangeLog b/ChangeLog
index d8c440355a8..f50cec1cda8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12010-04-01 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * configure.in: Remove all references to LIBX11_SYSTEM.
4
12010-03-30 Dan Nicolaescu <dann@ics.uci.edu> 52010-03-30 Dan Nicolaescu <dann@ics.uci.edu>
2 6
3 * configure.in: Remove all references to C_DEBUG_SWITCH. 7 * configure.in: Remove all references to C_DEBUG_SWITCH.
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index caf05a88ce5..a50a2ab6100 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -7,9 +7,7 @@ CYGWIN Compiling the Cygwin port.
7__CYGWIN__ Ditto 7__CYGWIN__ Ditto
8MSDOS Compiling the MS-DOS port. 8MSDOS Compiling the MS-DOS port.
9__MSDOS__ Ditto. 9__MSDOS__ Ditto.
10__DJGPP__ Major version number of the DJGPP library for the DOS port. 10__DJGPP_MINOR__ Minor version number of the DJGPP library; used only in msdos.c and dosfns.c.
11__DJGPP_MINOR__ Minor version number of the DJGPP library.
12__GO32__ Compiling the DOS port with DJGPP v1.x (obsolete).
13DOS_NT Compiling for either the MS-DOS or native MS-Windows port. 11DOS_NT Compiling for either the MS-DOS or native MS-Windows port.
14WINDOWSNT Compiling the native MS-Windows (W32) port. 12WINDOWSNT Compiling the native MS-Windows (W32) port.
15__MINGW32__ Compiling the W32 port with the MinGW port of GCC. 13__MINGW32__ Compiling the W32 port with the MinGW port of GCC.
@@ -236,7 +234,6 @@ LD_SWITCH_X_DEFAULT
236LIBS_MACHINE 234LIBS_MACHINE
237LIBS_SYSTEM 235LIBS_SYSTEM
238LIBS_TERMCAP 236LIBS_TERMCAP
239LIBX11_SYSTEM
240LIBXMU 237LIBXMU
241LIB_GCC 238LIB_GCC
242LIB_MATH 239LIB_MATH
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 90ba61f7850..cf96d99d3b1 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,7 @@
12010-04-01 Eli Zaretskii <eliz@gnu.org>
2
3 * CPP-DEFINES (__DJGPP__, __GO32__): Remove, no longer used.
4
12010-03-10 Chong Yidong <cyd@stupidchicken.com> 52010-03-10 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * Branch for 23.2. 7 * Branch for 23.2.
diff --git a/configure b/configure
index 7d0662ce346..e63b74b8780 100755
--- a/configure
+++ b/configure
@@ -5796,10 +5796,7 @@ configure___ c_switch_machine=C_SWITCH_MACHINE
5796#define LIB_X11_LIB -lX11 5796#define LIB_X11_LIB -lX11
5797#endif 5797#endif
5798 5798
5799#ifndef LIBX11_SYSTEM 5799configure___ LIBX=LIB_X11_LIB
5800#define LIBX11_SYSTEM
5801#endif
5802configure___ LIBX=LIB_X11_LIB LIBX11_SYSTEM
5803 5800
5804#ifdef UNEXEC 5801#ifdef UNEXEC
5805configure___ unexec=UNEXEC 5802configure___ unexec=UNEXEC
diff --git a/configure.in b/configure.in
index fc7c0a93235..515b779b52b 100644
--- a/configure.in
+++ b/configure.in
@@ -865,10 +865,7 @@ configure___ c_switch_machine=C_SWITCH_MACHINE
865#define LIB_X11_LIB -lX11 865#define LIB_X11_LIB -lX11
866#endif 866#endif
867 867
868#ifndef LIBX11_SYSTEM 868configure___ LIBX=LIB_X11_LIB
869#define LIBX11_SYSTEM
870#endif
871configure___ LIBX=LIB_X11_LIB LIBX11_SYSTEM
872 869
873#ifdef UNEXEC 870#ifdef UNEXEC
874configure___ unexec=UNEXEC 871configure___ unexec=UNEXEC
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 95dea96487d..34f285beee9 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12010-04-01 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * gnus.texi (Finding the News): Add pointers to the Server buffer
4 because it's essential.
5
12010-03-31 Katsumi Yamaoka <yamaoka@jpl.org> 62010-03-31 Katsumi Yamaoka <yamaoka@jpl.org>
2 7
3 * gnus.texi (MIME Commands): Update description of 8 * gnus.texi (MIME Commands): Update description of
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index cc0fb6e822e..7a3fe922cee 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -996,6 +996,15 @@ terminology section (@pxref{Terminology}).
996@section Finding the News 996@section Finding the News
997@cindex finding news 997@cindex finding news
998 998
999First of all, you should know that there is a special buffer called
1000@code{*Server*} that lists all the servers Gnus knows about. You can
1001press @kbd{^} from the Group buffer to see it. In the Server buffer,
1002you can press @kbd{RET} on a defined server to see all the groups it
1003serves (subscribed or not!). You can also add or delete servers, edit
1004a foreign server's definition, agentize or de-agentize a server, and
1005do many other neat things. @xref{Server Buffer}.
1006@xref{Foreign Groups}. @xref{Agent Basics}.
1007
999@vindex gnus-select-method 1008@vindex gnus-select-method
1000@c @head 1009@c @head
1001The @code{gnus-select-method} variable says where Gnus should look for 1010The @code{gnus-select-method} variable says where Gnus should look for
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 4e9c7e19ff7..ad7ce6da3c2 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,10 @@
12010-04-02 Dan Nicolaescu <dann@ics.uci.edu>
2
3 Remove extern errno declarations.
4 * movemail.c:
5 * etags.c:
6 * emacsclient.c: Remove extern errno declarations.
7
12010-03-20 Glenn Morris <rgm@gnu.org> 82010-03-20 Glenn Morris <rgm@gnu.org>
2 9
3 * Makefile.in (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB) 10 * Makefile.in (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 01241b518bb..1e7ec7d9678 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -723,7 +723,6 @@ main (argc, argv)
723#define SEND_BUFFER_SIZE 4096 723#define SEND_BUFFER_SIZE 4096
724 724
725extern char *strerror (); 725extern char *strerror ();
726extern int errno;
727 726
728/* Buffer to accumulate data to send in TCP connections. */ 727/* Buffer to accumulate data to send in TCP connections. */
729char send_buffer[SEND_BUFFER_SIZE + 1]; 728char send_buffer[SEND_BUFFER_SIZE + 1];
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 17aad9a2252..89edc6c1b27 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -188,9 +188,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
188#include <stdio.h> 188#include <stdio.h>
189#include <ctype.h> 189#include <ctype.h>
190#include <errno.h> 190#include <errno.h>
191#ifndef errno
192 extern int errno;
193#endif
194#include <sys/types.h> 191#include <sys/types.h>
195#include <sys/stat.h> 192#include <sys/stat.h>
196 193
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index e0eb4d48b89..a887eb216ac 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -140,9 +140,6 @@ static char *mail_spool_name ();
140#endif 140#endif
141#endif 141#endif
142 142
143#ifndef errno
144extern int errno;
145#endif
146char *strerror (); 143char *strerror ();
147#ifdef HAVE_INDEX 144#ifdef HAVE_INDEX
148extern char *index __P ((const char *, int)); 145extern char *index __P ((const char *, int));
diff --git a/msdos/ChangeLog b/msdos/ChangeLog
index e0b31ecbd50..45e7b57859a 100644
--- a/msdos/ChangeLog
+++ b/msdos/ChangeLog
@@ -1,3 +1,12 @@
12010-04-01 Eli Zaretskii <eliz@gnu.org>
2
3 Remove support for DJGPP v1.x.
4
5 * sed3.inp:
6 * sed2.inp:
7 * sed1.inp:
8 * mainmake: Files removed.
9
12010-03-27 Eli Zaretskii <eliz@gnu.org> 102010-03-27 Eli Zaretskii <eliz@gnu.org>
2 11
3 * sedlisp.inp (VPATH): Don't edit, no longer needed. 12 * sedlisp.inp (VPATH): Don't edit, no longer needed.
diff --git a/msdos/mainmake b/msdos/mainmake
deleted file mode 100644
index c5f2f88d51a..00000000000
--- a/msdos/mainmake
+++ /dev/null
@@ -1,96 +0,0 @@
1# Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004,
2# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3
4# This file is part of GNU Emacs.
5
6# GNU Emacs is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10
11# GNU Emacs is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15
16# You should have received a copy of the GNU General Public License
17# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
18
19# make all to compile and build Emacs.
20# make install to install it.
21# make TAGS to update tags tables.
22#
23# make clean or make mostlyclean
24# Delete all files from the current directory that are normally
25# created by building the program. Don't delete the files that
26# record the configuration. Also preserve files that could be made
27# by building, but normally aren't because the distribution comes
28# with them.
29#
30# Delete `.dvi' files here if they are not part of the distribution.
31#
32# make distclean
33# Delete all files from the current directory that are created by
34# configuring or building the program. If you have unpacked the
35# source and built the program without creating any other files,
36# `make distclean' should leave only the files that were in the
37# distribution.
38#
39# make realclean
40# Delete everything from the current directory that can be
41# reconstructed with this Makefile. This typically includes
42# everything deleted by distclean, plus more: C source files
43# produced by Bison, tags tables, info files, and so on.
44#
45# make extraclean
46# Still more severe - delete backup and autosave files, too.
47
48all: lib-src src
49
50lib-src: FRC
51 cd lib-src
52 $(MAKE)
53 cd ..
54
55src: FRC
56 cd src
57 $(MAKE)
58 cd ..
59
60install: all
61 -md bin
62 cd lib-src
63 coff2exe hexl
64 coff2exe etags
65 coff2exe ctags
66 coff2exe b2m
67 mv -f hexl.exe etags.exe ctags.exe b2m.exe ../bin/
68 cd ..
69 cd src
70 coff2exe emacs
71 stubedit emacs.exe minstack=512k
72 mv -f emacs.exe ../bin/
73 cd ..
74
75FRC:
76
77TAGS tags: lib-src
78 cd src
79 go32 ../lib-src/etags *.[ch] ../lisp/*.el ../lisp/term/*.el
80 cd ..
81
82check:
83 @echo "We don't have any tests for GNU Emacs yet."
84
85clean:
86 cd lib-src
87 $(MAKE) clean
88 cd ..
89 cd src
90 $(MAKE) clean
91 cd ..
92 cd oldxmenu
93 -$(MAKE) clean
94 cd ..
95
96# arch-tag: d5a489bc-818e-4c3c-8040-b5205ed0602f
diff --git a/msdos/sed1.inp b/msdos/sed1.inp
deleted file mode 100644
index 4ecbbfa0800..00000000000
--- a/msdos/sed1.inp
+++ /dev/null
@@ -1,57 +0,0 @@
1# -sed1.inp-------------------------------------------------------------
2# Configuration script for src/makefile
3# ----------------------------------------------------------------------
4#
5# Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
6# 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
7#
8# This file is part of GNU Emacs.
9#
10# This file is free software; as a special exception, the author gives
11# unlimited permission to copy and/or distribute it, with or without
12# modifications, as long as this notice is preserved.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17#
18# ----------------------------------------------------------------------
19# In case src/Makefile needs to rebuild `make-doc.exe' (might happen under
20# Windows 95), make sure it gets built with commands that DOS
21# understands (one command per line).
22s/^#.*//
23s/^[ \f\t][ \f\t]*$//
24s/^ / /
25s/\.h\.in/.h-in/
26s!^ \./temacs! go32 temacs!
27s!/bin/sh!command.com!
28/^MAKE *=/s/^/# /
29/^SHELL *=/s/^/# /
30/^srcdir *=/s/@[^@\n]*@/./
31/^VPATH *=/s/@[^@\n]*@/./
32/^CC *=/s/@[^@\n]*@/gcc/
33/^CPP *=/s/@[^@\n]*@/gcc -e/
34/^CFLAGS *=/s/@[^@\n]*@/-O2 -g/
35/^LIBS *=/s/@[^@\n]*@//
36/^LIBOBJS *=/s/@[^@\n]*@//
37/^LN_S *=/s/@[^@\n]*@/ln -s/
38/^M_FILE *=/s!@[^@\n]*@!m/intel386.h!
39/^S_FILE *=/s!@[^@\n]*@!s/msdos.h!
40/^@SET_MAKE@$/s/@SET_MAKE@//
41/^.\${libsrc}make-docfile.*>/s!make-docfile!make-doc.exe -o ../etc/DOC!
42/^.\${libsrc}make-doc/s!>.*$!!
43/^\${libsrc}make-docfile:/c\
44${libsrc}make-doc.exe:\
45 cd ..\
46 cd lib-src\
47 $(MAKE) ${MFLAGS} make-docfile -W make-docfile.c\
48 cd ..\
49 cd src
50/^ cd \${libsrc}; \${MAKE} \${MFLAGS} make-docfile/d
51/\${libsrc}make-docfile/s/-docfile[ ]/-doc.exe /
52/^[ ]*$/d
53/^temacs:/s/prefix-args//
54/^temacs:/s/stamp-oldxmenu//
55/^ #/d
56
57# arch-tag: 246725c1-79de-4d03-a080-8f19329fa35e
diff --git a/msdos/sed2.inp b/msdos/sed2.inp
deleted file mode 100644
index beb95c25346..00000000000
--- a/msdos/sed2.inp
+++ /dev/null
@@ -1,56 +0,0 @@
1# -sed2.inp-------------------------------------------------------------
2# Configuration script for src/config.h
3# ----------------------------------------------------------------------
4#
5# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
6# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
7#
8# This file is part of GNU Emacs.
9#
10# This file is free software; as a special exception, the author gives
11# unlimited permission to copy and/or distribute it, with or without
12# modifications, as long as this notice is preserved.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17#
18# ----------------------------------------------------------------------
19/^#undef LISP_FLOAT_TYPE *$/s/undef/define/
20/^#undef GNU_MALLOC *$/s/undef/define/
21/^#undef REL_ALLOC *$/s/undef/define/
22/^#undef HAVE_SYS_SELECT/i\
23/^#undef STDC_HEADERS *$/s/undef/define/
24/^#undef HAVE_SYS_TIMEB_H *$/s/undef/define/
25/^#undef HAVE_SYS_TIME_H *$/s/undef/define/
26# /^#undef HAVE_UNISTD_H *$/s/undef/define/
27/^#undef HAVE_GETTIMEOFDAY *$/s/undef/define/
28/^#undef HAVE_GETHOSTNAME *$/s/undef/define/
29/^#undef HAVE_DUP2 *$/s/undef/define/
30/^#undef HAVE_TM_ZONE *$/s/undef/define/
31/^#undef LOCALTIME_CACHE *$/s/undef/define/
32/^#undef HAVE_TZSET *$/s/undef/define/
33/^#undef TM_IN_SYS_TIME *$/s/undef/define/
34/^#undef TIME_WITH_SYS_TIME *$/s/undef/define/
35/^#undef HAVE_RENAME *$/s/undef/define/
36/^#undef HAVE_CLOSEDIR *$/s/undef/define/
37/^#undef HAVE_RANDOM *$/s/undef/define/
38/^#undef HAVE_MKDIR *$/s/undef/define/
39/^#undef HAVE_RMDIR *$/s/undef/define/
40/^#undef HAVE_BCMP *$/s/undef/define/
41/^#undef HAVE_BCOPY *$/s/undef/define/
42/^#undef HAVE_FREXP *$/s/undef/define/
43/^#undef HAVE_FTIME *$/s/undef/define/
44/^#undef HAVE_MKTIME *$/s/undef/define/
45/^#undef HAVE_STRERROR *$/s/undef/define/
46/^#undef HAVE_TIMEVAL *$/s/undef/define/
47s/^#define USER_FULL_NAME .*$/#define USER_FULL_NAME (getenv ("NAME"))/
48s/^#undef STACK_DIRECTION *$/#define STACK_DIRECTION -1/
49s/^#undef EMACS_CONFIGURATION *$/#define EMACS_CONFIGURATION "i386-pc-msdosdjgpp"/
50s/^#undef EMACS_CONFIG_OPTIONS *$/#define EMACS_CONFIG_OPTIONS "-"/
51s!^#undef config_opsysfile *$!#define config_opsysfile "s/msdos.h"!
52s!^#undef config_machfile *$!#define config_machfile "m/intel386.h"!
53s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/
54s/^#undef POINTER_TYPE *$/#define POINTER_TYPE void/
55
56# arch-tag: 31840234-109a-41ab-a675-7a3844978299
diff --git a/msdos/sed3.inp b/msdos/sed3.inp
deleted file mode 100644
index 8f97b309d2e..00000000000
--- a/msdos/sed3.inp
+++ /dev/null
@@ -1,54 +0,0 @@
1# -sed3.inp-------------------------------------------------------------
2# Configuration script for lib-src/makefile
3# ----------------------------------------------------------------------
4#
5# Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004,
6# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
7#
8# This file is part of GNU Emacs.
9#
10# This file is free software; as a special exception, the author gives
11# unlimited permission to copy and/or distribute it, with or without
12# modifications, as long as this notice is preserved.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17#
18# ----------------------------------------------------------------------
19/^# DIST: /d
20/^SHELL *=/s/^/# /
21/^CC *=/s/=.*$/=gcc/
22# Actually, here we should patch in the exact version number, but only
23# [ce]tags uses it. Don't pass it. This is more update-resistant.
24/-DVERSION=/s/-DVERSION="\\"\${version}\\""//
25/^configname *=/s/=.*$/=msdos/
26/^archlibdir *=/s!=.*$!=/emacs/bin!
27/^bindir *=/s!=.*$!=/emacs/bin!
28/^libdir *=/s!=.*$!=/emacs/bin!
29/^srcdir *=/s!=.*$!=.!
30/^VPATH *=/s!=.*$!=.!
31/^KRB4LIB *=/s/@[^@\n]*@//g
32/^DESLIB *=/s/@[^@\n]*@//g
33/^KRB5LIB *=/s/@[^@\n]*@//g
34/^CRYPTOLIB *=/s/@[^@\n]*@//g
35/^COM_ERRLIB *=/s/@[^@\n]*@//g
36/^LIBHESIOD *=/s/@[^@\n]*@//g
37/^LIBRESOLV *=/s/@[^@\n]*@//g
38/^LIBS_MAIL *=/s/@[^@\n]*@//g
39/^CFLAGS *=/s!=.*$!=-O2 -g!
40/^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS!
41/^LOADLIBES *=/s!=.*$!=!
42/^ALLOCA *=/s!=.*$!=alloca.o!
43/^INSTALLABLES/s/emacsclient *//
44s!^ \./! go32 ./!
45/^UTILITIES=/s/ wakeup//
46/^UTILITIES=/s/ movemail//
47/^UTILITIES=/s/ emacsserver//
48/^UTILITIES=/s/ timer//
49/^all *:/s/$/ make-docfile/
50s!^ go32 ./test-distrib! go32 ./test-dis!
51/-o make-docfile/a\
52 coff2exe make-docfile
53
54# arch-tag: cac6f5c7-3dbf-4e84-9d0c-44f0126f0ea8
diff --git a/src/ChangeLog b/src/ChangeLog
index 908d83759f3..8859a10ad7a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,66 @@
12010-04-02 Dan Nicolaescu <dann@ics.uci.edu>
2
3 Remove extern errno declarations.
4 * xterm.c:
5 * xrdb.c:
6 * w32term.c:
7 * unexec.c:
8 * unexaix.c:
9 * sysdep.c:
10 * process.c:
11 * lread.c:
12 * keyboard.c:
13 * floatfns.c:
14 * filelock.c:
15 * fileio.c:
16 * emacs.c (main):
17 * ecrt0.c:
18 * dispnew.c:
19 * callproc.c:
20 * buffer.c: Remove errno extern declarations.
21 * s/netbsd.h (NEED_ERRNO): Remove.
22
232010-04-01 Dan Nicolaescu <dann@ics.uci.edu>
24
25 Remove all uses of LIBX11_SYSTEM.
26 * Makefile.in (LIBX11_SYSTEM): Remove.
27 * s/msdos.h (LIBX11_SYSTEM): Do not define, define LIBS_SYSTEM
28 instead.
29
302010-04-01 Eli Zaretskii <eliz@gnu.org>
31
32 Remove support for DJGPP v1.x (bug#5813).
33
34 * w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility.
35 * s/msdos.h:
36 * unexec.c (make_hdr, copy_text_and_data):
37 * sysdep.c (wait_for_termination, sys_subshell):
38 * msdos.c (dos_set_window_size, msdos_set_cursor_shape)
39 (IT_set_terminal_modes, __write, _rename, gethostname)
40 (gettimeofday, alarm, fork, kill, dos_ttraw, dos_ttcooked)
41 (run_msdos_command, abort): Remove DJGPP v1.x code and tests of
42 the value of __DJGPP__.
43 (nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x
44 compatibility code.
45 * lread.c:
46 * gmalloc.c (memalign):
47 * fileio.c (Fcopy_file, check_executable, Ffile_modes):
48 * emacs.c (main):
49 * dosfns.c (init_dosfns):
50 * dired.c (file_name_completion_stat): Remove tests of __DJGPP__.
51
522010-04-01 Eli Zaretskii <eliz@gnu.org>
53
54 * xdisp.c (set_cursor_from_row): Fix cursor positioning when the
55 string with `cursor' property comes from an `after-string'
56 overlay. (Bug#5816)
57
582010-04-01 Glenn Morris <rgm@gnu.org>
59
60 * Makefile.in (LIBTIFF, LIBJPEG, LIBPNG, LIBGIF, LIBXPM, XFT_LIBS):
61 Define as Makefile variables.
62 (LIBX): Use above variables rather than directly using autoconf.
63
12010-03-31 Dan Nicolaescu <dann@ics.uci.edu> 642010-03-31 Dan Nicolaescu <dann@ics.uci.edu>
2 65
3 Clean up BSD_SYSTEM use. 66 Clean up BSD_SYSTEM use.
diff --git a/src/Makefile.in b/src/Makefile.in
index 2305f6f6533..cd5027dc4d8 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -68,6 +68,13 @@ bootstrap_exe = ${abs_builddir}/bootstrap-emacs${EXEEXT}
68 68
69OTHER_FILES = @OTHER_FILES@ 69OTHER_FILES = @OTHER_FILES@
70 70
71LIBTIFF=@LIBTIFF@
72LIBJPEG=@LIBJPEG@
73LIBPNG=@LIBPNG@
74LIBGIF=@LIBGIF@
75LIBXPM=@LIBXPM@
76XFT_LIBS=@XFT_LIBS@
77
71# ========================== start of cpp stuff ======================= 78# ========================== start of cpp stuff =======================
72/* From here on, comments must be done in C syntax. */ 79/* From here on, comments must be done in C syntax. */
73 80
@@ -277,10 +284,6 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
277#endif 284#endif
278 $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $< 285 $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
279 286
280#ifndef LIBX11_SYSTEM
281#define LIBX11_SYSTEM
282#endif
283
284#ifndef LIB_X11_LIB 287#ifndef LIB_X11_LIB
285#define LIB_X11_LIB -lX11 288#define LIB_X11_LIB -lX11
286#endif 289#endif
@@ -369,7 +372,7 @@ LIBXT=$(LIBW)
369/* LD_SWITCH_X_DEFAULT comes after everything else that specifies 372/* LD_SWITCH_X_DEFAULT comes after everything else that specifies
370 options for where to find X libraries, but before those libraries. */ 373 options for where to find X libraries, but before those libraries. */
371X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT 374X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT
372LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) @LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@ LIB_X11_LIB LIBX11_SYSTEM @XFT_LIBS@ 375LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) $(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) LIB_X11_LIB $(XFT_LIBS)
373#else /* not HAVE_X11 */ 376#else /* not HAVE_X11 */
374LIBX= $(LIBXMENU) LD_SWITCH_X_SITE 377LIBX= $(LIBXMENU) LD_SWITCH_X_SITE
375#endif /* not HAVE_X11 */ 378#endif /* not HAVE_X11 */
diff --git a/src/buffer.c b/src/buffer.c
index 0c6e57d45be..9035a986b4c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -28,11 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28#include <stdio.h> 28#include <stdio.h>
29#include <setjmp.h> 29#include <setjmp.h>
30 30
31#ifndef USE_CRT_DLL
32extern int errno;
33#endif
34
35
36#ifdef HAVE_UNISTD_H 31#ifdef HAVE_UNISTD_H
37#include <unistd.h> 32#include <unistd.h>
38#endif 33#endif
@@ -4627,7 +4622,6 @@ buffer_slot_type_mismatch (newval, type)
4627#endif 4622#endif
4628 4623
4629#include <stdio.h> 4624#include <stdio.h>
4630#include <errno.h>
4631 4625
4632#if MAP_ANON == 0 4626#if MAP_ANON == 0
4633#include <fcntl.h> 4627#include <fcntl.h>
diff --git a/src/callproc.c b/src/callproc.c
index bed3302e508..378c647f385 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -25,10 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25#include <stdio.h> 25#include <stdio.h>
26#include <setjmp.h> 26#include <setjmp.h>
27 27
28#ifndef USE_CRT_DLL
29extern int errno;
30#endif
31
32/* Define SIGCHLD as an alias for SIGCLD. */ 28/* Define SIGCHLD as an alias for SIGCLD. */
33 29
34#if !defined (SIGCHLD) && defined (SIGCLD) 30#if !defined (SIGCHLD) && defined (SIGCLD)
@@ -61,7 +57,6 @@ extern int errno;
61#include <fcntl.h> 57#include <fcntl.h>
62#include <sys/stat.h> 58#include <sys/stat.h>
63#include <sys/param.h> 59#include <sys/param.h>
64#include <errno.h>
65#endif /* MSDOS */ 60#endif /* MSDOS */
66 61
67#ifndef O_RDONLY 62#ifndef O_RDONLY
diff --git a/src/dired.c b/src/dired.c
index 951969be0a4..2240f6ec76e 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -859,7 +859,6 @@ file_name_completion_stat (dirname, dp, st_addr)
859 char *fullname = (char *) alloca (len + pos + 2); 859 char *fullname = (char *) alloca (len + pos + 2);
860 860
861#ifdef MSDOS 861#ifdef MSDOS
862#if __DJGPP__ > 1
863 /* Some fields of struct stat are *very* expensive to compute on MS-DOS, 862 /* Some fields of struct stat are *very* expensive to compute on MS-DOS,
864 but aren't required here. Avoid computing the following fields: 863 but aren't required here. Avoid computing the following fields:
865 st_inode, st_size and st_nlink for directories, and the execute bits 864 st_inode, st_size and st_nlink for directories, and the execute bits
@@ -868,7 +867,6 @@ file_name_completion_stat (dirname, dp, st_addr)
868 unsigned short save_djstat_flags = _djstat_flags; 867 unsigned short save_djstat_flags = _djstat_flags;
869 868
870 _djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE; 869 _djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
871#endif /* __DJGPP__ > 1 */
872#endif /* MSDOS */ 870#endif /* MSDOS */
873 871
874 bcopy (SDATA (dirname), fullname, pos); 872 bcopy (SDATA (dirname), fullname, pos);
@@ -888,9 +886,7 @@ file_name_completion_stat (dirname, dp, st_addr)
888#else 886#else
889 value = stat (fullname, st_addr); 887 value = stat (fullname, st_addr);
890#ifdef MSDOS 888#ifdef MSDOS
891#if __DJGPP__ > 1
892 _djstat_flags = save_djstat_flags; 889 _djstat_flags = save_djstat_flags;
893#endif /* __DJGPP__ > 1 */
894#endif /* MSDOS */ 890#endif /* MSDOS */
895 return value; 891 return value;
896#endif /* S_IFLNK */ 892#endif /* S_IFLNK */
diff --git a/src/dispnew.c b/src/dispnew.c
index 52d7f38728f..2be00c9c3b0 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5809,9 +5809,6 @@ window_change_signal (signalnum) /* If we don't have an argument, */
5809 int signalnum; /* some compilers complain in signal calls. */ 5809 int signalnum; /* some compilers complain in signal calls. */
5810{ 5810{
5811 int width, height; 5811 int width, height;
5812#ifndef USE_CRT_DLL
5813 extern int errno;
5814#endif
5815 int old_errno = errno; 5812 int old_errno = errno;
5816 5813
5817 struct tty_display_info *tty; 5814 struct tty_display_info *tty;
diff --git a/src/dosfns.c b/src/dosfns.c
index d04c28b3156..e8756de21a1 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -48,10 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
48#include <grp.h> 48#include <grp.h>
49#include <crt0.h> 49#include <crt0.h>
50 50
51#ifndef __DJGPP_MINOR__
52# define __tb _go32_info_block.linear_address_of_transfer_buffer;
53#endif
54
55DEFUN ("int86", Fint86, Sint86, 2, 2, 0, 51DEFUN ("int86", Fint86, Sint86, 2, 2, 0,
56 doc: /* Call specific MS-DOS interrupt number INTERRUPT with REGISTERS. 52 doc: /* Call specific MS-DOS interrupt number INTERRUPT with REGISTERS.
57Return the updated REGISTER vector. 53Return the updated REGISTER vector.
@@ -385,8 +381,6 @@ init_dosfns ()
385 } 381 }
386#endif /* !HAVE_X_WINDOWS */ 382#endif /* !HAVE_X_WINDOWS */
387 383
388#if __DJGPP__ >= 2
389
390 /* Without this, we never see hidden files. 384 /* Without this, we never see hidden files.
391 Don't OR it with the previous value, so the value recorded at dump 385 Don't OR it with the previous value, so the value recorded at dump
392 time, possibly with `preserve-case' flags set, won't get through. */ 386 time, possibly with `preserve-case' flags set, won't get through. */
@@ -398,7 +392,6 @@ init_dosfns ()
398 if (!NILP (Fmsdos_long_file_names ())) 392 if (!NILP (Fmsdos_long_file_names ()))
399 __opendir_flags |= __OPENDIR_PRESERVE_CASE; 393 __opendir_flags |= __OPENDIR_PRESERVE_CASE;
400#endif /* __DJGPP_MINOR__ == 0 */ 394#endif /* __DJGPP_MINOR__ == 0 */
401#endif /* __DJGPP__ >= 2 */
402} 395}
403 396
404#ifndef HAVE_X_WINDOWS 397#ifndef HAVE_X_WINDOWS
diff --git a/src/ecrt0.c b/src/ecrt0.c
index 7dbbd6c5ef1..40549884935 100644
--- a/src/ecrt0.c
+++ b/src/ecrt0.c
@@ -59,10 +59,6 @@ And always:
59 59
60int data_start = 0; 60int data_start = 0;
61 61
62#ifdef NEED_ERRNO
63int errno;
64#endif
65
66#ifndef MSDOS 62#ifndef MSDOS
67char **environ; 63char **environ;
68#endif 64#endif
diff --git a/src/emacs.c b/src/emacs.c
index 6327fd8a7d3..400a6b0e594 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -756,9 +756,6 @@ main (int argc, char **argv)
756 char stack_bottom_variable; 756 char stack_bottom_variable;
757 int do_initial_setlocale; 757 int do_initial_setlocale;
758 int skip_args = 0; 758 int skip_args = 0;
759#ifndef USE_CRT_DLL
760 extern int errno;
761#endif
762#ifdef HAVE_SETRLIMIT 759#ifdef HAVE_SETRLIMIT
763 struct rlimit rlim; 760 struct rlimit rlim;
764#endif 761#endif
@@ -945,7 +942,6 @@ main (int argc, char **argv)
945#endif /* MSDOS || WINDOWSNT */ 942#endif /* MSDOS || WINDOWSNT */
946 943
947#ifdef MSDOS 944#ifdef MSDOS
948#if __DJGPP__ >= 2
949 if (!isatty (fileno (stdin))) 945 if (!isatty (fileno (stdin)))
950 setmode (fileno (stdin), O_BINARY); 946 setmode (fileno (stdin), O_BINARY);
951 if (!isatty (fileno (stdout))) 947 if (!isatty (fileno (stdout)))
@@ -953,11 +949,6 @@ main (int argc, char **argv)
953 fflush (stdout); 949 fflush (stdout);
954 setmode (fileno (stdout), O_BINARY); 950 setmode (fileno (stdout), O_BINARY);
955 } 951 }
956#else /* not __DJGPP__ >= 2 */
957 (stdin)->_flag &= ~_IOTEXT;
958 (stdout)->_flag &= ~_IOTEXT;
959 (stderr)->_flag &= ~_IOTEXT;
960#endif /* not __DJGPP__ >= 2 */
961#endif /* MSDOS */ 952#endif /* MSDOS */
962 953
963#ifdef SET_EMACS_PRIORITY 954#ifdef SET_EMACS_PRIORITY
diff --git a/src/fileio.c b/src/fileio.c
index a80ba11bcab..c62d5724eff 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -53,12 +53,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
53#include <ctype.h> 53#include <ctype.h>
54#include <errno.h> 54#include <errno.h>
55 55
56#ifndef vax11c
57#ifndef USE_CRT_DLL
58extern int errno;
59#endif
60#endif
61
62#include "lisp.h" 56#include "lisp.h"
63#include "intervals.h" 57#include "intervals.h"
64#include "buffer.h" 58#include "buffer.h"
@@ -79,11 +73,9 @@ extern int errno;
79#ifdef MSDOS 73#ifdef MSDOS
80#include "msdos.h" 74#include "msdos.h"
81#include <sys/param.h> 75#include <sys/param.h>
82#if __DJGPP__ >= 2
83#include <fcntl.h> 76#include <fcntl.h>
84#include <string.h> 77#include <string.h>
85#endif 78#endif
86#endif
87 79
88#ifdef DOS_NT 80#ifdef DOS_NT
89#define CORRECT_DIR_SEPS(s) \ 81#define CORRECT_DIR_SEPS(s) \
@@ -2012,7 +2004,6 @@ uid and gid of FILE to NEWNAME. */)
2012 copyable by us. */ 2004 copyable by us. */
2013 input_file_statable_p = (fstat (ifd, &st) >= 0); 2005 input_file_statable_p = (fstat (ifd, &st) >= 0);
2014 2006
2015#if !defined (MSDOS) || __DJGPP__ > 1
2016 if (out_st.st_mode != 0 2007 if (out_st.st_mode != 0
2017 && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) 2008 && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
2018 { 2009 {
@@ -2020,7 +2011,6 @@ uid and gid of FILE to NEWNAME. */)
2020 report_file_error ("Input and output files are the same", 2011 report_file_error ("Input and output files are the same",
2021 Fcons (file, Fcons (newname, Qnil))); 2012 Fcons (file, Fcons (newname, Qnil)));
2022 } 2013 }
2023#endif
2024 2014
2025#if defined (S_ISREG) && defined (S_ISLNK) 2015#if defined (S_ISREG) && defined (S_ISLNK)
2026 if (input_file_statable_p) 2016 if (input_file_statable_p)
@@ -2091,7 +2081,7 @@ uid and gid of FILE to NEWNAME. */)
2091 2081
2092 emacs_close (ifd); 2082 emacs_close (ifd);
2093 2083
2094#if defined (__DJGPP__) && __DJGPP__ > 1 2084#ifdef MSDOS
2095 if (input_file_statable_p) 2085 if (input_file_statable_p)
2096 { 2086 {
2097 /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, 2087 /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
@@ -2101,7 +2091,7 @@ uid and gid of FILE to NEWNAME. */)
2101 if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) 2091 if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
2102 chmod (SDATA (encoded_newname), st.st_mode & 07777); 2092 chmod (SDATA (encoded_newname), st.st_mode & 07777);
2103 } 2093 }
2104#endif /* DJGPP version 2 or newer */ 2094#endif /* MSDOS */
2105#endif /* not WINDOWSNT */ 2095#endif /* not WINDOWSNT */
2106 2096
2107 /* Discard the unwind protects. */ 2097 /* Discard the unwind protects. */
@@ -2477,16 +2467,7 @@ check_executable (filename)
2477 struct stat st; 2467 struct stat st;
2478 if (stat (filename, &st) < 0) 2468 if (stat (filename, &st) < 0)
2479 return 0; 2469 return 0;
2480#if defined (WINDOWSNT) || (defined (MSDOS) && __DJGPP__ > 1)
2481 return ((st.st_mode & S_IEXEC) != 0); 2470 return ((st.st_mode & S_IEXEC) != 0);
2482#else
2483 return (S_ISREG (st.st_mode)
2484 && len >= 5
2485 && (xstrcasecmp ((suffix = filename + len-4), ".com") == 0
2486 || xstrcasecmp (suffix, ".exe") == 0
2487 || xstrcasecmp (suffix, ".bat") == 0)
2488 || (st.st_mode & S_IFMT) == S_IFDIR);
2489#endif /* not WINDOWSNT */
2490#else /* not DOS_NT */ 2471#else /* not DOS_NT */
2491#ifdef HAVE_EUIDACCESS 2472#ifdef HAVE_EUIDACCESS
2492 return (euidaccess (filename, 1) >= 0); 2473 return (euidaccess (filename, 1) >= 0);
@@ -2885,10 +2866,6 @@ Return nil, if file does not exist or is not accessible. */)
2885 2866
2886 if (stat (SDATA (absname), &st) < 0) 2867 if (stat (SDATA (absname), &st) < 0)
2887 return Qnil; 2868 return Qnil;
2888#if defined (MSDOS) && __DJGPP__ < 2
2889 if (check_executable (SDATA (absname)))
2890 st.st_mode |= S_IEXEC;
2891#endif /* MSDOS && __DJGPP__ < 2 */
2892 2869
2893 return make_number (st.st_mode & 07777); 2870 return make_number (st.st_mode & 07777);
2894} 2871}
diff --git a/src/filelock.c b/src/filelock.c
index 7c69ea954fc..b11338c58b6 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -47,9 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47#endif /* __FreeBSD__ */ 47#endif /* __FreeBSD__ */
48 48
49#include <errno.h> 49#include <errno.h>
50#ifndef errno
51extern int errno;
52#endif
53 50
54#include "lisp.h" 51#include "lisp.h"
55#include "buffer.h" 52#include "buffer.h"
diff --git a/src/floatfns.c b/src/floatfns.c
index 97d9ec00aae..3f7030b7605 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -99,10 +99,6 @@ extern double logb ();
99 99
100#ifdef FLOAT_CHECK_ERRNO 100#ifdef FLOAT_CHECK_ERRNO
101# include <errno.h> 101# include <errno.h>
102
103#ifndef USE_CRT_DLL
104extern int errno;
105#endif
106#endif 102#endif
107 103
108#ifdef FLOAT_CATCH_SIGILL 104#ifdef FLOAT_CATCH_SIGILL
diff --git a/src/gmalloc.c b/src/gmalloc.c
index f1be37ba348..6445c56e6d4 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -122,7 +122,7 @@ extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size));
122extern void free PP ((__ptr_t __ptr)); 122extern void free PP ((__ptr_t __ptr));
123 123
124/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ 124/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
125#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ 125#if !defined (_MALLOC_INTERNAL) || defined (MSDOS) /* Avoid conflict. */
126extern __ptr_t memalign PP ((__malloc_size_t __alignment, 126extern __ptr_t memalign PP ((__malloc_size_t __alignment,
127 __malloc_size_t __size)); 127 __malloc_size_t __size));
128extern int posix_memalign PP ((__ptr_t *, __malloc_size_t, 128extern int posix_memalign PP ((__ptr_t *, __malloc_size_t,
@@ -1763,13 +1763,6 @@ Fifth Floor, Boston, MA 02110-1301, USA. */
1763#include <malloc.h> 1763#include <malloc.h>
1764#endif 1764#endif
1765 1765
1766#if __DJGPP__ - 0 == 1
1767
1768/* There is some problem with memalign in DJGPP v1 and we are supposed
1769 to omit it. Noone told me why, they just told me to do it. */
1770
1771#else
1772
1773__ptr_t (*__memalign_hook) PP ((__malloc_size_t __size, 1766__ptr_t (*__memalign_hook) PP ((__malloc_size_t __size,
1774 __malloc_size_t __alignment)); 1767 __malloc_size_t __alignment));
1775 1768
@@ -1878,7 +1871,6 @@ posix_memalign (memptr, alignment, size)
1878 return 0; 1871 return 0;
1879} 1872}
1880 1873
1881#endif /* Not DJGPP v1 */
1882/* Allocate memory on a page boundary. 1874/* Allocate memory on a page boundary.
1883 Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc. 1875 Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc.
1884 1876
diff --git a/src/keyboard.c b/src/keyboard.c
index 3cd042fb21e..f2aeff89542 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -79,10 +79,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
79#include "nsterm.h" 79#include "nsterm.h"
80#endif 80#endif
81 81
82#ifndef USE_CRT_DLL
83extern int errno;
84#endif
85
86/* Variables for blockinput.h: */ 82/* Variables for blockinput.h: */
87 83
88/* Non-zero if interrupt input is blocked right now. */ 84/* Non-zero if interrupt input is blocked right now. */
diff --git a/src/lread.c b/src/lread.c
index ba9d5378104..83ebc8b3b10 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -41,9 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
41#include "blockinput.h" 41#include "blockinput.h"
42 42
43#ifdef MSDOS 43#ifdef MSDOS
44#if __DJGPP__ < 2
45#include <unistd.h> /* to get X_OK */
46#endif
47#include "msdos.h" 44#include "msdos.h"
48#endif 45#endif
49 46
@@ -76,10 +73,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
76#define file_tell ftell 73#define file_tell ftell
77#endif 74#endif
78 75
79#ifndef USE_CRT_DLL
80extern int errno;
81#endif
82
83/* hash table read constants */ 76/* hash table read constants */
84Lisp_Object Qhash_table, Qdata; 77Lisp_Object Qhash_table, Qdata;
85Lisp_Object Qtest, Qsize; 78Lisp_Object Qtest, Qsize;
diff --git a/src/msdos.c b/src/msdos.c
index a413184f966..6cde7cd6ebc 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -39,7 +39,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
39#include <sys/stat.h> /* for _fixpath */ 39#include <sys/stat.h> /* for _fixpath */
40#include <unistd.h> /* for chdir, dup, dup2, etc. */ 40#include <unistd.h> /* for chdir, dup, dup2, etc. */
41#include <dir.h> /* for getdisk */ 41#include <dir.h> /* for getdisk */
42#if __DJGPP__ >= 2
43#pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */ 42#pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */
44#include <fcntl.h> 43#include <fcntl.h>
45#include <io.h> /* for setmode */ 44#include <io.h> /* for setmode */
@@ -47,7 +46,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47#include <sys/farptr.h> /* for _farsetsel, _farnspokeb */ 46#include <sys/farptr.h> /* for _farsetsel, _farnspokeb */
48#include <libc/dosio.h> /* for _USE_LFN */ 47#include <libc/dosio.h> /* for _USE_LFN */
49#include <conio.h> /* for cputs */ 48#include <conio.h> /* for cputs */
50#endif
51 49
52#include "msdos.h" 50#include "msdos.h"
53#include "systime.h" 51#include "systime.h"
@@ -81,8 +79,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
81#define _dos_ds _go32_info_block.selector_for_linear_memory 79#define _dos_ds _go32_info_block.selector_for_linear_memory
82#endif 80#endif
83 81
84#if __DJGPP__ > 1
85
86#include <signal.h> 82#include <signal.h>
87#include "syssignal.h" 83#include "syssignal.h"
88 84
@@ -104,7 +100,6 @@ int _crt0_startup_flags = (_CRT0_FLAG_UNIX_SBRK | _CRT0_FLAG_FILL_SBRK_MEMORY);
104#endif /* GNU_MALLOC */ 100#endif /* GNU_MALLOC */
105 101
106#endif /* not SYSTEM_MALLOC */ 102#endif /* not SYSTEM_MALLOC */
107#endif /* __DJGPP__ > 1 */
108 103
109static unsigned long 104static unsigned long
110event_timestamp () 105event_timestamp ()
@@ -427,7 +422,6 @@ extern Lisp_Object Qbar, Qhbar;
427 colors for newly-created frames. */ 422 colors for newly-created frames. */
428static int initial_screen_colors[2]; 423static int initial_screen_colors[2];
429 424
430#if __DJGPP__ > 1
431/* Update the screen from a part of relocated DOS/V screen buffer which 425/* Update the screen from a part of relocated DOS/V screen buffer which
432 begins at OFFSET and includes COUNT characters. */ 426 begins at OFFSET and includes COUNT characters. */
433static void 427static void
@@ -444,7 +438,6 @@ dosv_refresh_virtual_screen (int offset, int count)
444 regs.x.cx = count; 438 regs.x.cx = count;
445 __dpmi_int (0x10, &regs); 439 __dpmi_int (0x10, &regs);
446} 440}
447#endif
448 441
449static void 442static void
450dos_direct_output (y, x, buf, len) 443dos_direct_output (y, x, buf, len)
@@ -456,67 +449,12 @@ dos_direct_output (y, x, buf, len)
456 int t = t0 + (int) ScreenPrimary; 449 int t = t0 + (int) ScreenPrimary;
457 int l0 = len; 450 int l0 = len;
458 451
459#if (__DJGPP__ < 2)
460 while (--len >= 0) {
461 dosmemput (buf++, 1, t);
462 t += 2;
463 }
464#else
465 /* This is faster. */ 452 /* This is faster. */
466 for (_farsetsel (_dos_ds); --len >= 0; t += 2, buf++) 453 for (_farsetsel (_dos_ds); --len >= 0; t += 2, buf++)
467 _farnspokeb (t, *buf); 454 _farnspokeb (t, *buf);
468 455
469 if (screen_virtual_segment) 456 if (screen_virtual_segment)
470 dosv_refresh_virtual_screen (t0, l0); 457 dosv_refresh_virtual_screen (t0, l0);
471#endif
472}
473#endif
474
475/* Flash the screen as a substitute for BEEPs. */
476
477#if (__DJGPP__ < 2)
478static void
479do_visible_bell (xorattr)
480 unsigned char xorattr;
481{
482 asm volatile
483 (" movb $1,%%dl \n\
484visible_bell_0: \n\
485 movl _ScreenPrimary,%%eax \n\
486 call dosmemsetup \n\
487 movl %%eax,%%ebx \n\
488 movl %1,%%ecx \n\
489 movb %0,%%al \n\
490 incl %%ebx \n\
491visible_bell_1: \n\
492 xorb %%al,%%gs:(%%ebx) \n\
493 addl $2,%%ebx \n\
494 decl %%ecx \n\
495 jne visible_bell_1 \n\
496 decb %%dl \n\
497 jne visible_bell_3 \n\
498visible_bell_2: \n\
499 movzwl %%ax,%%eax \n\
500 movzwl %%ax,%%eax \n\
501 movzwl %%ax,%%eax \n\
502 movzwl %%ax,%%eax \n\
503 decw %%cx \n\
504 jne visible_bell_2 \n\
505 jmp visible_bell_0 \n\
506visible_bell_3:"
507 : /* no output */
508 : "m" (xorattr), "g" (screen_size)
509 : "%eax", "%ebx", /* "%gs",*/ "%ecx", "%edx");
510}
511
512static void
513ScreenVisualBell (void)
514{
515 /* This creates an xor-mask that will swap the default fore- and
516 background colors. */
517 do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ())
518 ^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()))
519 * 0x11) & 0x7f);
520} 458}
521#endif 459#endif
522 460
@@ -611,9 +549,6 @@ dos_set_window_size (rows, cols)
611 549
612 /* Find one of the dimensions supported by standard EGA/VGA 550 /* Find one of the dimensions supported by standard EGA/VGA
613 which gives us at least the required dimensions. */ 551 which gives us at least the required dimensions. */
614
615#if __DJGPP__ > 1
616
617 else 552 else
618 { 553 {
619 static struct { 554 static struct {
@@ -642,41 +577,6 @@ dos_set_window_size (rows, cols)
642 } 577 }
643 } 578 }
644 579
645#else /* not __DJGPP__ > 1 */
646
647 else if (*rows <= 25)
648 {
649 if (current_rows != 25 || current_cols != 80)
650 {
651 regs.x.ax = 3;
652 int86 (0x10, &regs, &regs);
653 regs.x.ax = 0x1101;
654 regs.h.bl = 0;
655 int86 (0x10, &regs, &regs);
656 regs.x.ax = 0x1200;
657 regs.h.bl = 32;
658 int86 (0x10, &regs, &regs);
659 regs.x.ax = 3;
660 int86 (0x10, &regs, &regs);
661 }
662 }
663 else if (*rows <= 50)
664 if (have_vga && (current_rows != 50 || current_cols != 80)
665 || *rows <= 43 && (current_rows != 43 || current_cols != 80))
666 {
667 regs.x.ax = 3;
668 int86 (0x10, &regs, &regs);
669 regs.x.ax = 0x1112;
670 regs.h.bl = 0;
671 int86 (0x10, &regs, &regs);
672 regs.x.ax = 0x1200;
673 regs.h.bl = 32;
674 int86 (0x10, &regs, &regs);
675 regs.x.ax = 0x0100;
676 regs.x.cx = 7;
677 int86 (0x10, &regs, &regs);
678 }
679#endif /* not __DJGPP__ > 1 */
680 580
681 if (have_mouse) 581 if (have_mouse)
682 { 582 {
@@ -693,7 +593,6 @@ dos_set_window_size (rows, cols)
693 screen_size_Y = *rows; 593 screen_size_Y = *rows;
694 screen_size = *cols * *rows; 594 screen_size = *cols * *rows;
695 595
696#if __DJGPP__ > 1
697 /* If the dimensions changed, the mouse highlight info is invalid. */ 596 /* If the dimensions changed, the mouse highlight info is invalid. */
698 if (current_rows != *rows || current_cols != *cols) 597 if (current_rows != *rows || current_cols != *cols)
699 { 598 {
@@ -708,7 +607,6 @@ dos_set_window_size (rows, cols)
708 dpyinfo->mouse_face_window = Qnil; 607 dpyinfo->mouse_face_window = Qnil;
709 } 608 }
710 } 609 }
711#endif
712 610
713 /* Enable bright background colors. */ 611 /* Enable bright background colors. */
714 bright_bg (); 612 bright_bg ();
@@ -747,7 +645,6 @@ mouse_off_maybe ()
747static void 645static void
748msdos_set_cursor_shape (struct frame *f, int start_line, int width) 646msdos_set_cursor_shape (struct frame *f, int start_line, int width)
749{ 647{
750#if __DJGPP__ > 1
751 unsigned desired_cursor; 648 unsigned desired_cursor;
752 __dpmi_regs regs; 649 __dpmi_regs regs;
753 int max_line, top_line, bot_line; 650 int max_line, top_line, bot_line;
@@ -824,7 +721,6 @@ msdos_set_cursor_shape (struct frame *f, int start_line, int width)
824 regs.h.ah = 1; 721 regs.h.ah = 1;
825 regs.x.cx = desired_cursor; 722 regs.x.cx = desired_cursor;
826 __dpmi_int (0x10, &regs); 723 __dpmi_int (0x10, &regs);
827#endif /* __DJGPP__ > 1 */
828} 724}
829 725
830static void 726static void
@@ -2041,7 +1937,6 @@ IT_set_terminal_modes (struct terminal *term)
2041 startup_screen_size_Y = screen_size_Y; 1937 startup_screen_size_Y = screen_size_Y;
2042 startup_screen_attrib = ScreenAttrib; 1938 startup_screen_attrib = ScreenAttrib;
2043 1939
2044#if __DJGPP__ > 1
2045 /* Is DOS/V (or any other RSIS software which relocates 1940 /* Is DOS/V (or any other RSIS software which relocates
2046 the screen) installed? */ 1941 the screen) installed? */
2047 { 1942 {
@@ -2072,7 +1967,6 @@ IT_set_terminal_modes (struct terminal *term)
2072 ScreenPrimary = (screen_virtual_segment << 4) + screen_virtual_offset; 1967 ScreenPrimary = (screen_virtual_segment << 4) + screen_virtual_offset;
2073 } 1968 }
2074 } 1969 }
2075#endif /* __DJGPP__ > 1 */
2076 1970
2077 ScreenGetCursor (&startup_pos_Y, &startup_pos_X); 1971 ScreenGetCursor (&startup_pos_Y, &startup_pos_X);
2078 ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2)); 1972 ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2));
@@ -4068,195 +3962,6 @@ crlf_to_lf (n, buf)
4068 return np - startp; 3962 return np - startp;
4069} 3963}
4070 3964
4071#if defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 0
4072
4073/* In DJGPP v2.0, library `write' can call `malloc', which might
4074 cause relocation of the buffer whose address we get in ADDR.
4075 Here is a version of `write' that avoids calling `malloc',
4076 to serve us until such time as the library is fixed.
4077 Actually, what we define here is called `__write', because
4078 `write' is a stub that just jmp's to `__write' (to be
4079 POSIXLY-correct with respect to the global name-space). */
4080
4081#include <io.h> /* for _write */
4082#include <libc/dosio.h> /* for __file_handle_modes[] */
4083
4084static char xbuf[64 * 1024]; /* DOS cannot write more in one chunk */
4085
4086#define XBUF_END (xbuf + sizeof (xbuf) - 1)
4087
4088int
4089__write (int handle, const void *buffer, size_t count)
4090{
4091 if (count == 0)
4092 return 0;
4093
4094 if(__file_handle_modes[handle] & O_BINARY)
4095 return _write (handle, buffer, count);
4096 else
4097 {
4098 char *xbp = xbuf;
4099 const char *bp = buffer;
4100 int total_written = 0;
4101 int nmoved = 0, ncr = 0;
4102
4103 while (count)
4104 {
4105 /* The next test makes sure there's space for at least 2 more
4106 characters in xbuf[], so both CR and LF can be put there. */
4107 if (xbp < XBUF_END)
4108 {
4109 if (*bp == '\n')
4110 {
4111 ncr++;
4112 *xbp++ = '\r';
4113 }
4114 *xbp++ = *bp++;
4115 nmoved++;
4116 count--;
4117 }
4118 if (xbp >= XBUF_END || !count)
4119 {
4120 size_t to_write = nmoved + ncr;
4121 int written = _write (handle, xbuf, to_write);
4122
4123 if (written == -1)
4124 return -1;
4125 else
4126 total_written += nmoved; /* CRs aren't counted in ret value */
4127
4128 /* If some, but not all were written (disk full?), return
4129 an estimate of the total written bytes not counting CRs. */
4130 if (written < to_write)
4131 return total_written - (to_write - written) * nmoved/to_write;
4132
4133 nmoved = 0;
4134 ncr = 0;
4135 xbp = xbuf;
4136 }
4137 }
4138 return total_written;
4139 }
4140}
4141
4142/* A low-level file-renaming function which works around Windows 95 bug.
4143 This is pulled directly out of DJGPP v2.01 library sources, and only
4144 used when you compile with DJGPP v2.0. */
4145
4146#include <io.h>
4147
4148int _rename(const char *old, const char *new)
4149{
4150 __dpmi_regs r;
4151 int olen = strlen(old) + 1;
4152 int i;
4153 int use_lfn = _USE_LFN;
4154 char tempfile[FILENAME_MAX];
4155 const char *orig = old;
4156 int lfn_fd = -1;
4157
4158 r.x.dx = __tb_offset;
4159 r.x.di = __tb_offset + olen;
4160 r.x.ds = r.x.es = __tb_segment;
4161
4162 if (use_lfn)
4163 {
4164 /* Windows 95 bug: for some filenames, when you rename
4165 file -> file~ (as in Emacs, to leave a backup), the
4166 short 8+3 alias doesn't change, which effectively
4167 makes OLD and NEW the same file. We must rename
4168 through a temporary file to work around this. */
4169
4170 char *pbase = 0, *p;
4171 static char try_char[] = "abcdefghijklmnopqrstuvwxyz012345789";
4172 int idx = sizeof(try_char) - 1;
4173
4174 /* Generate a temporary name. Can't use `tmpnam', since $TMPDIR
4175 might point to another drive, which will fail the DOS call. */
4176 strcpy(tempfile, old);
4177 for (p = tempfile; *p; p++) /* ensure temporary is on the same drive */
4178 if (*p == '/' || *p == '\\' || *p == ':')
4179 pbase = p;
4180 if (pbase)
4181 pbase++;
4182 else
4183 pbase = tempfile;
4184 strcpy(pbase, "X$$djren$$.$$temp$$");
4185
4186 do
4187 {
4188 if (idx <= 0)
4189 return -1;
4190 *pbase = try_char[--idx];
4191 } while (_chmod(tempfile, 0) != -1);
4192
4193 r.x.ax = 0x7156;
4194 _put_path2(tempfile, olen);
4195 _put_path(old);
4196 __dpmi_int(0x21, &r);
4197 if (r.x.flags & 1)
4198 {
4199 errno = __doserr_to_errno(r.x.ax);
4200 return -1;
4201 }
4202
4203 /* Now create a file with the original name. This will
4204 ensure that NEW will always have a 8+3 alias
4205 different from that of OLD. (Seems to be required
4206 when NameNumericTail in the Registry is set to 0.) */
4207 lfn_fd = _creat(old, 0);
4208
4209 olen = strlen(tempfile) + 1;
4210 old = tempfile;
4211 r.x.di = __tb_offset + olen;
4212 }
4213
4214 for (i=0; i<2; i++)
4215 {
4216 if(use_lfn)
4217 r.x.ax = 0x7156;
4218 else
4219 r.h.ah = 0x56;
4220 _put_path2(new, olen);
4221 _put_path(old);
4222 __dpmi_int(0x21, &r);
4223 if(r.x.flags & 1)
4224 {
4225 if (r.x.ax == 5 && i == 0) /* access denied */
4226 remove(new); /* and try again */
4227 else
4228 {
4229 errno = __doserr_to_errno(r.x.ax);
4230
4231 /* Restore to original name if we renamed it to temporary. */
4232 if (use_lfn)
4233 {
4234 if (lfn_fd != -1)
4235 {
4236 _close (lfn_fd);
4237 remove (orig);
4238 }
4239 _put_path2(orig, olen);
4240 _put_path(tempfile);
4241 r.x.ax = 0x7156;
4242 __dpmi_int(0x21, &r);
4243 }
4244 return -1;
4245 }
4246 }
4247 else
4248 break;
4249 }
4250
4251 /* Success. Delete the file possibly created to work
4252 around the Windows 95 bug. */
4253 if (lfn_fd != -1)
4254 return (_close (lfn_fd) == 0) ? remove (orig) : -1;
4255 return 0;
4256}
4257
4258#endif /* __DJGPP__ == 2 && __DJGPP_MINOR__ == 0 */
4259
4260DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names, 3965DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names,
4261 0, 0, 0, 3966 0, 0, 0,
4262 doc: /* Return non-nil if long file names are supported on MS-DOS. */) 3967 doc: /* Return non-nil if long file names are supported on MS-DOS. */)
@@ -4502,39 +4207,6 @@ init_environment (argc, argv, skip_args)
4502static int break_stat; /* BREAK check mode status. */ 4207static int break_stat; /* BREAK check mode status. */
4503static int stdin_stat; /* stdin IOCTL status. */ 4208static int stdin_stat; /* stdin IOCTL status. */
4504 4209
4505#if __DJGPP__ < 2
4506
4507/* These must be global. */
4508static _go32_dpmi_seginfo ctrl_break_vector;
4509static _go32_dpmi_registers ctrl_break_regs;
4510static int ctrlbreakinstalled = 0;
4511
4512/* Interrupt level detection of Ctrl-Break. Don't do anything fancy here! */
4513
4514void
4515ctrl_break_func (regs)
4516 _go32_dpmi_registers *regs;
4517{
4518 Vquit_flag = Qt;
4519}
4520
4521void
4522install_ctrl_break_check ()
4523{
4524 if (!ctrlbreakinstalled)
4525 {
4526 /* Don't press Ctrl-Break if you don't have either DPMI or Emacs
4527 was compiler with Djgpp 1.11 maintenance level 5 or later! */
4528 ctrlbreakinstalled = 1;
4529 ctrl_break_vector.pm_offset = (int) ctrl_break_func;
4530 _go32_dpmi_allocate_real_mode_callback_iret (&ctrl_break_vector,
4531 &ctrl_break_regs);
4532 _go32_dpmi_set_real_mode_interrupt_vector (0x1b, &ctrl_break_vector);
4533 }
4534}
4535
4536#endif /* __DJGPP__ < 2 */
4537
4538/* Turn off Dos' Ctrl-C checking and inhibit interpretation of 4210/* Turn off Dos' Ctrl-C checking and inhibit interpretation of
4539 control chars by DOS. Determine the keyboard type. */ 4211 control chars by DOS. Determine the keyboard type. */
4540 4212
@@ -4551,9 +4223,6 @@ dos_ttraw (struct tty_display_info *tty)
4551 4223
4552 break_stat = getcbrk (); 4224 break_stat = getcbrk ();
4553 setcbrk (0); 4225 setcbrk (0);
4554#if __DJGPP__ < 2
4555 install_ctrl_break_check ();
4556#endif
4557 4226
4558 if (first_time) 4227 if (first_time)
4559 { 4228 {
@@ -4585,42 +4254,18 @@ dos_ttraw (struct tty_display_info *tty)
4585 mouse_button_count = outregs.x.bx; 4254 mouse_button_count = outregs.x.bx;
4586 4255
4587#ifndef HAVE_X_WINDOWS 4256#ifndef HAVE_X_WINDOWS
4588#if __DJGPP__ >= 2
4589 /* Save the cursor shape used outside Emacs. */ 4257 /* Save the cursor shape used outside Emacs. */
4590 outside_cursor = _farpeekw (_dos_ds, 0x460); 4258 outside_cursor = _farpeekw (_dos_ds, 0x460);
4591#endif 4259#endif
4592#endif
4593 } 4260 }
4594 4261
4595 first_time = 0; 4262 first_time = 0;
4596 4263
4597#if __DJGPP__ >= 2
4598
4599 stdin_stat = setmode (fileno (stdin), O_BINARY); 4264 stdin_stat = setmode (fileno (stdin), O_BINARY);
4600 return (stdin_stat != -1); 4265 return (stdin_stat != -1);
4601 } 4266 }
4602 else 4267 else
4603 return (setmode (fileno (stdin), O_BINARY) != -1); 4268 return (setmode (fileno (stdin), O_BINARY) != -1);
4604
4605#else /* __DJGPP__ < 2 */
4606
4607 }
4608
4609 /* I think it is wrong to overwrite `stdin_stat' every time
4610 but the first one this function is called, but I don't
4611 want to change the way it used to work in v1.x.--EZ */
4612
4613 inregs.x.ax = 0x4400; /* Get IOCTL status. */
4614 inregs.x.bx = 0x00; /* 0 = stdin. */
4615 intdos (&inregs, &outregs);
4616 stdin_stat = outregs.h.dl;
4617
4618 inregs.x.dx = stdin_stat | 0x0020; /* raw mode */
4619 inregs.x.ax = 0x4401; /* Set IOCTL status */
4620 intdos (&inregs, &outregs);
4621 return !outregs.x.cflag;
4622
4623#endif /* __DJGPP__ < 2 */
4624} 4269}
4625 4270
4626/* Restore status of standard input and Ctrl-C checking. */ 4271/* Restore status of standard input and Ctrl-C checking. */
@@ -4633,8 +4278,6 @@ dos_ttcooked ()
4633 setcbrk (break_stat); 4278 setcbrk (break_stat);
4634 mouse_off (); 4279 mouse_off ();
4635 4280
4636#if __DJGPP__ >= 2
4637
4638#ifndef HAVE_X_WINDOWS 4281#ifndef HAVE_X_WINDOWS
4639 /* Restore the cursor shape we found on startup. */ 4282 /* Restore the cursor shape we found on startup. */
4640 if (outside_cursor) 4283 if (outside_cursor)
@@ -4646,16 +4289,6 @@ dos_ttcooked ()
4646#endif 4289#endif
4647 4290
4648 return (setmode (fileno (stdin), stdin_stat) != -1); 4291 return (setmode (fileno (stdin), stdin_stat) != -1);
4649
4650#else /* not __DJGPP__ >= 2 */
4651
4652 inregs.x.ax = 0x4401; /* Set IOCTL status. */
4653 inregs.x.bx = 0x00; /* 0 = stdin. */
4654 inregs.x.dx = stdin_stat;
4655 intdos (&inregs, &outregs);
4656 return !outregs.x.cflag;
4657
4658#endif /* not __DJGPP__ >= 2 */
4659} 4292}
4660 4293
4661 4294
@@ -4735,8 +4368,6 @@ run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv)
4735 dup2 (tempout, 1); 4368 dup2 (tempout, 1);
4736 dup2 (temperr, 2); 4369 dup2 (temperr, 2);
4737 4370
4738#if __DJGPP__ > 1
4739
4740 if (msshell && !argv[3]) 4371 if (msshell && !argv[3])
4741 { 4372 {
4742 /* MS-DOS native shells are too restrictive. For starters, they 4373 /* MS-DOS native shells are too restrictive. For starters, they
@@ -4777,10 +4408,7 @@ run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv)
4777 result = 0; /* emulate Unixy shell behavior with empty cmd line */ 4408 result = 0; /* emulate Unixy shell behavior with empty cmd line */
4778 } 4409 }
4779 else 4410 else
4780 4411 result = spawnve (P_WAIT, argv[0], argv, envv);
4781#endif /* __DJGPP__ > 1 */
4782
4783 result = spawnve (P_WAIT, argv[0], argv, envv);
4784 4412
4785 dup2 (inbak, 0); 4413 dup2 (inbak, 0);
4786 dup2 (outbak, 1); 4414 dup2 (outbak, 1);
@@ -4822,88 +4450,13 @@ croak (badfunc)
4822 exit (1); 4450 exit (1);
4823} 4451}
4824 4452
4825#if __DJGPP__ < 2
4826
4827/* ------------------------- Compatibility functions -------------------
4828 * gethostname
4829 * gettimeofday
4830 */
4831
4832/* Hostnames for a pc are not really funny,
4833 but they are used in change log so we emulate the best we can. */
4834
4835gethostname (p, size)
4836 char *p;
4837 int size;
4838{
4839 char *q = egetenv ("HOSTNAME");
4840
4841 if (!q) q = "pc";
4842 strcpy (p, q);
4843 return 0;
4844}
4845
4846/* When time zones are set from Ms-Dos too many C-libraries are playing
4847 tricks with time values. We solve this by defining our own version
4848 of `gettimeofday' bypassing GO32. Our version needs to be initialized
4849 once and after each call to `tzset' with TZ changed. That is
4850 accomplished by aliasing tzset to init_gettimeofday. */
4851
4852static struct tm time_rec;
4853
4854int
4855gettimeofday (struct timeval *tp, struct timezone *tzp)
4856{
4857 if (tp)
4858 {
4859 struct time t;
4860 struct tm tm;
4861
4862 gettime (&t);
4863 if (t.ti_hour < time_rec.tm_hour) /* midnight wrap */
4864 {
4865 struct date d;
4866 getdate (&d);
4867 time_rec.tm_year = d.da_year - 1900;
4868 time_rec.tm_mon = d.da_mon - 1;
4869 time_rec.tm_mday = d.da_day;
4870 }
4871
4872 time_rec.tm_hour = t.ti_hour;
4873 time_rec.tm_min = t.ti_min;
4874 time_rec.tm_sec = t.ti_sec;
4875
4876 tm = time_rec;
4877 tm.tm_gmtoff = dos_timezone_offset;
4878
4879 tp->tv_sec = mktime (&tm); /* may modify tm */
4880 tp->tv_usec = t.ti_hund * (1000000 / 100);
4881 }
4882 /* Ignore tzp; it's obsolescent. */
4883 return 0;
4884}
4885
4886#endif /* __DJGPP__ < 2 */
4887
4888/* 4453/*
4889 * A list of unimplemented functions that we silently ignore. 4454 * A few unimplemented functions that we silently ignore.
4890 */ 4455 */
4891
4892#if __DJGPP__ < 2
4893unsigned alarm (s) unsigned s; {}
4894fork () { return 0; }
4895int kill (x, y) int x, y; { return -1; }
4896nice (p) int p; {}
4897void volatile pause () {}
4898sigsetmask (x) int x; { return 0; }
4899sigblock (mask) int mask; { return 0; }
4900#endif
4901
4902setpgrp () {return 0; } 4456setpgrp () {return 0; }
4903setpriority (x,y,z) int x,y,z; { return 0; } 4457setpriority (x,y,z) int x,y,z; { return 0; }
4904 4458
4905#if __DJGPP__ > 1 4459#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
4906#if __DJGPP_MINOR__ < 2
4907 4460
4908#ifdef POSIX_SIGNALS 4461#ifdef POSIX_SIGNALS
4909 4462
@@ -5011,7 +4564,6 @@ sigblock (mask) int mask; { return 0; }
5011 4564
5012#endif /* not POSIX_SIGNALS */ 4565#endif /* not POSIX_SIGNALS */
5013#endif /* not __DJGPP_MINOR__ < 2 */ 4566#endif /* not __DJGPP_MINOR__ < 2 */
5014#endif /* __DJGPP__ > 1 */
5015 4567
5016#ifndef HAVE_SELECT 4568#ifndef HAVE_SELECT
5017#include "sysselect.h" 4569#include "sysselect.h"
@@ -5194,7 +4746,6 @@ abort ()
5194 dos_ttcooked (); 4746 dos_ttcooked ();
5195 ScreenSetCursor (10, 0); 4747 ScreenSetCursor (10, 0);
5196 cputs ("\r\n\nEmacs aborted!\r\n"); 4748 cputs ("\r\n\nEmacs aborted!\r\n");
5197#if __DJGPP__ > 1
5198#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 4749#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
5199 if (screen_virtual_segment) 4750 if (screen_virtual_segment)
5200 dosv_refresh_virtual_screen (2 * 10 * screen_size_X, 4 * screen_size_X); 4751 dosv_refresh_virtual_screen (2 * 10 * screen_size_X, 4 * screen_size_X);
@@ -5204,7 +4755,6 @@ abort ()
5204#else /* __DJGPP_MINOR__ >= 2 */ 4755#else /* __DJGPP_MINOR__ >= 2 */
5205 raise (SIGABRT); 4756 raise (SIGABRT);
5206#endif /* __DJGPP_MINOR__ >= 2 */ 4757#endif /* __DJGPP_MINOR__ >= 2 */
5207#endif
5208 exit (2); 4758 exit (2);
5209} 4759}
5210#endif 4760#endif
diff --git a/src/process.c b/src/process.c
index 43fa78c7bd4..3c539024b0a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -195,10 +195,6 @@ extern int serial_open (char *port);
195extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact); 195extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact);
196#endif 196#endif
197 197
198#ifndef USE_CRT_DLL
199extern int errno;
200#endif
201
202#ifndef HAVE_H_ERRNO 198#ifndef HAVE_H_ERRNO
203extern int h_errno; 199extern int h_errno;
204#endif 200#endif
diff --git a/src/s/msdos.h b/src/s/msdos.h
index 88771b9f15f..55f546589ec 100644
--- a/src/s/msdos.h
+++ b/src/s/msdos.h
@@ -30,11 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30#define MSDOS 30#define MSDOS
31#endif 31#endif
32 32
33#ifdef __GO32__
34#ifndef __DJGPP__ 33#ifndef __DJGPP__
35#define __DJGPP__ 1 /* V2 defines __DJGPP__ == 2 */
36#endif
37#else
38You lose; /* Emacs for DOS must be compiled with DJGPP */ 34You lose; /* Emacs for DOS must be compiled with DJGPP */
39#endif 35#endif
40 36
@@ -97,34 +93,11 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
97#define _setjmp setjmp 93#define _setjmp setjmp
98#define _longjmp longjmp 94#define _longjmp longjmp
99 95
100#if __DJGPP__ < 2
101
102/* New chdir () routine.
103 DJGPP v2.0 and later doesn't need it because its chdir() does
104 set the drive itself. */
105#ifdef chdir
106#undef chdir
107#endif
108#define chdir sys_chdir
109
110#define LIBS_SYSTEM -lpc /* isn't required in DJGPP v2.0, either */
111
112#endif /* __DJGPP__ < 2 */
113
114#if __DJGPP__ > 1
115
116#define DATA_START (&etext + 1) 96#define DATA_START (&etext + 1)
117#define TEXT_START &start 97#define TEXT_START &start
118 98
119#define _NAIVE_DOS_REGS 99#define _NAIVE_DOS_REGS
120 100
121#else /* not __DJGPP__ > 1 */
122
123/* This somehow needs to be defined even though we use COFF. */
124#define TEXT_START -1
125
126#endif /* not __DJGPP__ > 1 */
127
128#define ORDINARY_LINK 101#define ORDINARY_LINK
129 102
130/* command.com does not understand `...` so we define this. */ 103/* command.com does not understand `...` so we define this. */
@@ -133,19 +106,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
133 106
134#define NULL_DEVICE "nul" 107#define NULL_DEVICE "nul"
135 108
136#if __DJGPP__ < 2
137#define O_RDONLY 0x0001
138#define O_WRONLY 0x0002
139#define O_RDWR 0x0004
140#define O_CREAT 0x0100
141#define O_TRUNC 0x0200
142#define O_EXCL 0x0400
143#define O_APPEND 0x0800
144#define O_TEXT 0x4000
145#define O_BINARY 0x8000
146#define NO_MATHERR
147#endif
148
149#define HAVE_INVERSE_HYPERBOLIC 109#define HAVE_INVERSE_HYPERBOLIC
150#define FLOAT_CHECK_DOMAIN 110#define FLOAT_CHECK_DOMAIN
151 111
@@ -166,12 +126,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
166#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\') 126#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
167#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) 127#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
168 128
169/* Call init_gettimeofday when TZ changes. */
170#if __DJGPP__ < 2
171#define LOCALTIME_CACHE
172#define tzset init_gettimeofday
173#endif
174
175/* bcopy under djgpp is quite safe */ 129/* bcopy under djgpp is quite safe */
176#define GAP_USE_BCOPY 130#define GAP_USE_BCOPY
177#define BCOPY_UPWARD_SAFE 1 131#define BCOPY_UPWARD_SAFE 1
@@ -181,9 +135,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
181#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B") 135#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B")
182 136
183/* Do we have POSIX signals? */ 137/* Do we have POSIX signals? */
184#if __DJGPP__ > 1
185#define POSIX_SIGNALS 138#define POSIX_SIGNALS
186#endif
187 139
188/* We have (the code to control) a mouse. */ 140/* We have (the code to control) a mouse. */
189#define HAVE_MOUSE 141#define HAVE_MOUSE
@@ -197,7 +149,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
197 commentary below, in the non-X branch. The 140KB number was 149 commentary below, in the non-X branch. The 140KB number was
198 measured on GNU/Linux and on MS-WIndows. */ 150 measured on GNU/Linux and on MS-WIndows. */
199#define SYSTEM_PURESIZE_EXTRA (-170000+140000) 151#define SYSTEM_PURESIZE_EXTRA (-170000+140000)
200#define LIBX11_SYSTEM -lxext -lsys 152#define LIBS_SYSTEM -lxext -lsys
201#else 153#else
202/* We need a little extra space, see ../../lisp/loadup.el. 154/* We need a little extra space, see ../../lisp/loadup.el.
203 As of 20091024, DOS-specific files use up 62KB of pure space. But 155 As of 20091024, DOS-specific files use up 62KB of pure space. But
diff --git a/src/s/netbsd.h b/src/s/netbsd.h
index 5552aece50a..682b9482352 100644
--- a/src/s/netbsd.h
+++ b/src/s/netbsd.h
@@ -28,8 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28 28
29#define LIBS_TERMCAP -ltermcap 29#define LIBS_TERMCAP -ltermcap
30 30
31#define NEED_ERRNO
32
33#define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o 31#define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o
34#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1 32#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1
35#undef LIB_GCC 33#undef LIB_GCC
diff --git a/src/sysdep.c b/src/sysdep.c
index e23f52d92e5..37e7dfbaf9c 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -90,17 +90,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
90#include "msdos.h" 90#include "msdos.h"
91#include <sys/param.h> 91#include <sys/param.h>
92 92
93#if __DJGPP__ > 1
94extern int etext; 93extern int etext;
95extern unsigned start __asm__ ("start"); 94extern unsigned start __asm__ ("start");
96#endif 95#endif
97#endif
98
99#ifndef USE_CRT_DLL
100#ifndef errno
101extern int errno;
102#endif
103#endif
104 96
105#include <sys/file.h> 97#include <sys/file.h>
106 98
@@ -462,13 +454,7 @@ wait_for_termination (pid)
462#endif /* not POSIX_SIGNALS */ 454#endif /* not POSIX_SIGNALS */
463#endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ 455#endif /* not BSD_SYSTEM, and not HPUX version >= 6 */
464#else /* not subprocesses */ 456#else /* not subprocesses */
465#if __DJGPP__ > 1
466 break; 457 break;
467#else /* not __DJGPP__ > 1 */
468 if (kill (pid, 0) < 0)
469 break;
470 wait (0);
471#endif /* not __DJGPP__ > 1*/
472#endif /* not subprocesses */ 458#endif /* not subprocesses */
473 } 459 }
474} 460}
@@ -672,10 +658,8 @@ sys_subshell ()
672 658
673#ifdef DOS_NT 659#ifdef DOS_NT
674 pid = 0; 660 pid = 0;
675#if __DJGPP__ > 1
676 save_signal_handlers (saved_handlers); 661 save_signal_handlers (saved_handlers);
677 synch_process_alive = 1; 662 synch_process_alive = 1;
678#endif /* __DJGPP__ > 1 */
679#else 663#else
680 pid = vfork (); 664 pid = vfork ();
681 if (pid == -1) 665 if (pid == -1)
@@ -747,7 +731,7 @@ sys_subshell ()
747 } 731 }
748 732
749 /* Do this now if we did not do it before. */ 733 /* Do this now if we did not do it before. */
750#if !defined (MSDOS) || __DJGPP__ == 1 734#ifndef MSDOS
751 save_signal_handlers (saved_handlers); 735 save_signal_handlers (saved_handlers);
752 synch_process_alive = 1; 736 synch_process_alive = 1;
753#endif 737#endif
diff --git a/src/unexaix.c b/src/unexaix.c
index 97b69d7e5c7..2657d144296 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -435,7 +435,6 @@ write_segment (int new, char *ptr, char *end)
435{ 435{
436 int i, nwrite, ret; 436 int i, nwrite, ret;
437 char buf[80]; 437 char buf[80];
438 extern int errno;
439 char zeros[UnexBlockSz]; 438 char zeros[UnexBlockSz];
440 439
441 for (i = 0; ptr < end;) 440 for (i = 0; ptr < end;)
diff --git a/src/unexec.c b/src/unexec.c
index a1bb5460d3c..1a27db1232d 100644
--- a/src/unexec.c
+++ b/src/unexec.c
@@ -131,11 +131,9 @@ initialize nonstandard fields in the file header
131#ifdef HAVE_COFF_H 131#ifdef HAVE_COFF_H
132#include <coff.h> 132#include <coff.h>
133#ifdef MSDOS 133#ifdef MSDOS
134#if __DJGPP__ > 1
135#include <fcntl.h> /* for O_RDONLY, O_RDWR */ 134#include <fcntl.h> /* for O_RDONLY, O_RDWR */
136#include <crt0.h> /* for _crt0_startup_flags and its bits */ 135#include <crt0.h> /* for _crt0_startup_flags and its bits */
137static int save_djgpp_startup_flags; 136static int save_djgpp_startup_flags;
138#endif /* __DJGPP__ > 1 */
139#define filehdr external_filehdr 137#define filehdr external_filehdr
140#define scnhdr external_scnhdr 138#define scnhdr external_scnhdr
141#define syment external_syment 139#define syment external_syment
@@ -310,7 +308,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
310 if (a_out >= 0) 308 if (a_out >= 0)
311 { 309 {
312#ifdef MSDOS 310#ifdef MSDOS
313#if __DJGPP__ > 1
314 /* Support the coff-go32-exe format with a prepended stub, since 311 /* Support the coff-go32-exe format with a prepended stub, since
315 this is what GCC 2.8.0 and later generates by default in DJGPP. */ 312 this is what GCC 2.8.0 and later generates by default in DJGPP. */
316 unsigned short mz_header[3]; 313 unsigned short mz_header[3];
@@ -328,7 +325,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
328 } 325 }
329 else 326 else
330 lseek (a_out, 0L, 0); 327 lseek (a_out, 0L, 0);
331#endif /* __DJGPP__ > 1 */
332#endif /* MSDOS */ 328#endif /* MSDOS */
333 if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr)) 329 if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr))
334 { 330 {
@@ -470,9 +466,6 @@ write_segment (new, ptr, end)
470{ 466{
471 register int i, nwrite, ret; 467 register int i, nwrite, ret;
472 char buf[80]; 468 char buf[80];
473#ifndef USE_CRT_DLL
474 extern int errno;
475#endif
476 /* This is the normal amount to write at once. 469 /* This is the normal amount to write at once.
477 It is the size of block that NFS uses. */ 470 It is the size of block that NFS uses. */
478 int writesize = 1 << 13; 471 int writesize = 1 << 13;
@@ -532,7 +525,6 @@ copy_text_and_data (new, a_out)
532 register char *ptr; 525 register char *ptr;
533 526
534#ifdef MSDOS 527#ifdef MSDOS
535#if __DJGPP__ >= 2
536 /* Dump the original table of exception handlers, not the one 528 /* Dump the original table of exception handlers, not the one
537 where our exception hooks are registered. */ 529 where our exception hooks are registered. */
538 __djgpp_exception_toggle (); 530 __djgpp_exception_toggle ();
@@ -542,7 +534,6 @@ copy_text_and_data (new, a_out)
542 save_djgpp_startup_flags = _crt0_startup_flags; 534 save_djgpp_startup_flags = _crt0_startup_flags;
543 _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR); 535 _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR);
544#endif 536#endif
545#endif
546 537
547 lseek (new, (long) text_scnptr, 0); 538 lseek (new, (long) text_scnptr, 0);
548 ptr = (char *) f_ohdr.text_start; 539 ptr = (char *) f_ohdr.text_start;
@@ -555,14 +546,12 @@ copy_text_and_data (new, a_out)
555 write_segment (new, ptr, end); 546 write_segment (new, ptr, end);
556 547
557#ifdef MSDOS 548#ifdef MSDOS
558#if __DJGPP__ >= 2
559 /* Restore our exception hooks. */ 549 /* Restore our exception hooks. */
560 __djgpp_exception_toggle (); 550 __djgpp_exception_toggle ();
561 551
562 /* Restore the startup flags. */ 552 /* Restore the startup flags. */
563 _crt0_startup_flags = save_djgpp_startup_flags; 553 _crt0_startup_flags = save_djgpp_startup_flags;
564#endif 554#endif
565#endif
566 555
567 556
568 return 0; 557 return 0;
diff --git a/src/w16select.c b/src/w16select.c
index d6951be4d82..c6a84e46a60 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23 menus, and the Windows clipboard. */ 23 menus, and the Windows clipboard. */
24 24
25/* Written by Dale P. Smith <dpsm@en.com> */ 25/* Written by Dale P. Smith <dpsm@en.com> */
26/* Adapted to DJGPP v1 by Eli Zaretskii <eliz@is.elta.co.il> */ 26/* Adapted to DJGPP by Eli Zaretskii <eliz@gnu.org> */
27 27
28#ifdef MSDOS 28#ifdef MSDOS
29 29
@@ -94,25 +94,6 @@ static unsigned char *last_clipboard_text;
94/* The size of allocated storage for storing the clipboard data. */ 94/* The size of allocated storage for storing the clipboard data. */
95static size_t clipboard_storage_size; 95static size_t clipboard_storage_size;
96 96
97/* Emulation of `__dpmi_int' and friends for DJGPP v1.x */
98
99#if __DJGPP__ < 2
100
101typedef _go32_dpmi_registers __dpmi_regs;
102#define __tb _go32_info_block.linear_address_of_transfer_buffer
103#define _dos_ds _go32_info_block.selector_for_linear_memory
104
105static int
106__dpmi_int (intno, regs)
107 int intno;
108 __dpmi_regs *regs;
109{
110 regs->x.ss = regs->x.sp = regs->x.flags = 0;
111 return _go32_dpmi_simulate_int (intno, regs);
112}
113
114#endif /* __DJGPP__ < 2 */
115
116/* C functions to access the Windows 3.1x clipboard from DOS apps. 97/* C functions to access the Windows 3.1x clipboard from DOS apps.
117 98
118 The information was obtained from the Microsoft Knowledge Base, 99 The information was obtained from the Microsoft Knowledge Base,
diff --git a/src/w32term.c b/src/w32term.c
index 4ed7beda233..7222e26efd2 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -228,10 +228,6 @@ static int input_signal_count;
228 228
229extern Lisp_Object Vcommand_line_args, Vsystem_name; 229extern Lisp_Object Vcommand_line_args, Vsystem_name;
230 230
231#ifndef USE_CRT_DLL
232extern int errno;
233#endif
234
235/* A mask of extra modifier bits to put into every keyboard char. */ 231/* A mask of extra modifier bits to put into every keyboard char. */
236extern EMACS_INT extra_keyboard_modifiers; 232extern EMACS_INT extra_keyboard_modifiers;
237 233
diff --git a/src/xdisp.c b/src/xdisp.c
index 709ff5f6d68..997c76934d4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12606,7 +12606,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
12606 } 12606 }
12607 if (INTEGERP (glyph->object) && glyph->charpos < 0) 12607 if (INTEGERP (glyph->object) && glyph->charpos < 0)
12608 --glyph; 12608 --glyph;
12609 /* By default, put the cursor on the rightmost glyph. */ 12609 /* By default, in reversed rows we put the cursor on the
12610 rightmost (first in the reading order) glyph. */
12610 for (g = end + 1; g < glyph; g++) 12611 for (g = end + 1; g < glyph; g++)
12611 x += g->pixel_width; 12612 x += g->pixel_width;
12612 cursor_x = x; 12613 cursor_x = x;
@@ -12683,7 +12684,16 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
12683 bpos_covered = bpos_max + XINT (chprop); 12684 bpos_covered = bpos_max + XINT (chprop);
12684 /* If the `cursor' property covers buffer positions up 12685 /* If the `cursor' property covers buffer positions up
12685 to and including point, we should display cursor on 12686 to and including point, we should display cursor on
12686 this glyph. */ 12687 this glyph. Note that overlays and text properties
12688 with string values stop bidi reordering, so every
12689 buffer position to the left of the string is always
12690 smaller than any position to the right of the
12691 string. Therefore, if a `cursor' property on one
12692 of the string's characters has an integer value, we
12693 will break out of the loop below _before_ we get to
12694 the position match above. IOW, integer values of
12695 the `cursor' property override the "exact match for
12696 point" strategy of positioning the cursor. */
12687 /* Implementation note: bpos_max == pt_old when, e.g., 12697 /* Implementation note: bpos_max == pt_old when, e.g.,
12688 we are in an empty line, where bpos_max is set to 12698 we are in an empty line, where bpos_max is set to
12689 MATRIX_ROW_START_CHARPOS, see above. */ 12699 MATRIX_ROW_START_CHARPOS, see above. */
@@ -12823,12 +12833,19 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
12823 12833
12824 str = glyph->object; 12834 str = glyph->object;
12825 tem = string_buffer_position_lim (w, str, pos, pos_after, 0); 12835 tem = string_buffer_position_lim (w, str, pos, pos_after, 0);
12826 if (pos <= tem) 12836 if (tem == 0 /* from overlay */
12837 || pos <= tem)
12827 { 12838 {
12828 /* If the string from which this glyph came is 12839 /* If the string from which this glyph came is
12829 found in the buffer at point, then we've 12840 found in the buffer at point, then we've
12830 found the glyph we've been looking for. */ 12841 found the glyph we've been looking for. If
12831 if (tem == pt_old) 12842 it comes from an overlay (tem == 0), and it
12843 has the `cursor' property on one of its
12844 glyphs, record that glyph as a candidate for
12845 displaying the cursor. (As in the
12846 unidirectional version, we will display the
12847 cursor on the last candidate we find.) */
12848 if (tem == 0 || tem == pt_old)
12832 { 12849 {
12833 /* The glyphs from this string could have 12850 /* The glyphs from this string could have
12834 been reordered. Find the one with the 12851 been reordered. Find the one with the
@@ -12861,9 +12878,11 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
12861 } 12878 }
12862 } 12879 }
12863 12880
12864 goto compute_x; 12881 if (tem == pt_old)
12882 goto compute_x;
12865 } 12883 }
12866 pos = tem + 1; /* don't find previous instances */ 12884 if (tem)
12885 pos = tem + 1; /* don't find previous instances */
12867 } 12886 }
12868 /* This string is not what we want; skip all of the 12887 /* This string is not what we want; skip all of the
12869 glyphs that came from it. */ 12888 glyphs that came from it. */
diff --git a/src/xrdb.c b/src/xrdb.c
index c8cb55cb7b8..7808bacc59f 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
28#include <unistd.h> 28#include <unistd.h>
29#endif 29#endif
30 30
31#include <errno.h>
31#include <epaths.h> 32#include <epaths.h>
32 33
33#include <stdio.h> 34#include <stdio.h>
@@ -734,8 +735,6 @@ fatal (msg, prog, x1, x2, x3, x4, x5)
734 char *msg, *prog; 735 char *msg, *prog;
735 int x1, x2, x3, x4, x5; 736 int x1, x2, x3, x4, x5;
736{ 737{
737 extern int errno;
738
739 if (errno) 738 if (errno)
740 perror (prog); 739 perror (prog);
741 740
diff --git a/src/xterm.c b/src/xterm.c
index 1114fcccc53..90db15d9ed4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -309,8 +309,6 @@ extern Lisp_Object Vx_no_window_manager;
309 309
310extern Lisp_Object Qeql; 310extern Lisp_Object Qeql;
311 311
312extern int errno;
313
314/* A mask of extra modifier bits to put into every keyboard char. */ 312/* A mask of extra modifier bits to put into every keyboard char. */
315 313
316extern EMACS_INT extra_keyboard_modifiers; 314extern EMACS_INT extra_keyboard_modifiers;